Skip to content

Commit

Permalink
Hide qty 0 additional components from BOM
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Ruhland (hatchery) authored and formatc1702 committed Apr 16, 2024
1 parent ea4906c commit 42c89ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/wireviz/wv_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def get_additional_component_table(
rows = []
if component.additional_components:
rows.append(["Additional components"])
for part in component.additional_components:
# Ignore components that have qty 0
for part in [part for part in component.additional_components if component.get_qty_multiplier(part.qty_multiplier)]:
common_args = {
"qty": part.qty * component.get_qty_multiplier(part.qty_multiplier),
"unit": part.unit,
Expand Down Expand Up @@ -63,7 +64,8 @@ def get_additional_component_table(
def get_additional_component_bom(component: Union[Connector, Cable]) -> List[BOMEntry]:
"""Return a list of BOM entries with additional components."""
bom_entries = []
for part in component.additional_components:
# Ignore components that have qty 0
for part in [part for part in component.additional_components if component.get_qty_multiplier(part.qty_multiplier)]:
bom_entries.append(
{
"description": part.description,
Expand Down

0 comments on commit 42c89ca

Please sign in to comment.