From 088c804e6dae3279db99fa769aa2a2ad82e2b918 Mon Sep 17 00:00:00 2001 From: bouni Date: Tue, 17 Sep 2024 11:09:20 +0200 Subject: [PATCH] Fix 527 (#539) * Fix typo * Add info message why component is not added to BOM * Fix SQL query, reference != refs --- fabrication.py | 6 +++++- store.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fabrication.py b/fabrication.py index 68092a5..0eeb663 100644 --- a/fabrication.py +++ b/fabrication.py @@ -317,10 +317,14 @@ def generate_bom(self): components.remove(component) part["refs"] = ",".join(components) self.logger.info( - "Component %s has 'Do not placed' enabled: removing from BOM", + "Component %s has 'Do not place' enabled: removing from BOM", component, ) if not add_without_lcsc and not part["lcsc"]: + self.logger.info( + "Component %s has no LCSC number assigned and the setting Add parts without LCSC is disabled: removing from BOM", + component, + ) continue writer.writerow( [part["value"], part["refs"], part["footprint"], part["lcsc"]] diff --git a/store.py b/store.py index f0a5236..7c84fd6 100644 --- a/store.py +++ b/store.py @@ -100,7 +100,7 @@ def read_bom_parts(self) -> dict: query = f"SELECT value, GROUP_CONCAT(reference) AS refs, footprint, lcsc FROM ({subquery}) GROUP BY lcsc" a = cur.execute(query).fetchall() # Query all parts that are supposed to be in the BOM but have no lcsc number - query = "SELECT value, reference, footprint, lcsc FROM part_info WHERE exclude_from_bom = '0' AND lcsc = ''" + query = "SELECT value, reference AS refs, footprint, lcsc FROM part_info WHERE exclude_from_bom = '0' AND lcsc = ''" b = cur.execute(query).fetchall() return a + b