From 109a7cc721f81d93a07cf6156dd9041a8740199a Mon Sep 17 00:00:00 2001 From: Daniel Rojas Date: Sun, 1 Nov 2020 14:52:04 +0100 Subject: [PATCH] Fix empty BOM output --- src/wireviz/wv_bom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wireviz/wv_bom.py b/src/wireviz/wv_bom.py index a254ad3a..9d01cba4 100644 --- a/src/wireviz/wv_bom.py +++ b/src/wireviz/wv_bom.py @@ -111,7 +111,7 @@ def generate_bom(harness): total_qty = sum(entry['qty'] for entry in group_entries) bom.append({**group_entries[0], 'qty': round(total_qty, 3), 'designators': designators}) - bom = sorted(harness._bom, key=lambda k: k['item']) # sort list of dicts by their values (https://stackoverflow.com/a/73050) + bom = sorted(bom, key=lambda k: k['item']) # sort list of dicts by their values (https://stackoverflow.com/a/73050) # add an incrementing id to each bom item bom = [{**entry, 'id': index} for index, entry in enumerate(bom, 1)]