diff --git a/src/wireviz/wv_bom.py b/src/wireviz/wv_bom.py index 6689d79a..a233eca8 100644 --- a/src/wireviz/wv_bom.py +++ b/src/wireviz/wv_bom.py @@ -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, @@ -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,