Skip to content

Commit

Permalink
Fix 527 (#539)
Browse files Browse the repository at this point in the history
* Fix typo

* Add info message why component is not added to BOM

* Fix SQL query, reference != refs
  • Loading branch information
Bouni authored Sep 17, 2024
1 parent f2b5919 commit 088c804
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion fabrication.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]]
Expand Down
2 changes: 1 addition & 1 deletion store.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 088c804

Please sign in to comment.