Skip to content

Commit

Permalink
Merge pull request #34 from inventree/zero-quantity-fix
Browse files Browse the repository at this point in the history
Prevent zero quantity BOM items
  • Loading branch information
SchrodingersGat authored Jun 5, 2023
2 parents ccdd216 + 75085d1 commit fba3408
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion inventree_wireviz/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Version information for the inventree-wireviz plugin"""

PLUGIN_VERSION = "0.4.0"
PLUGIN_VERSION = "0.4.1"
16 changes: 9 additions & 7 deletions inventree_wireviz/wireviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,15 @@ def extract_bom_data(self, harness: Harness):
continue

# Construct a new BomItem object
self.bom_items.append(BomItem(
part=self.part,
sub_part=sub_part,
quantity=quantity,
reference=' '.join(designators),
note="Wireviz BOM item"
))
# Prevent zero-quantity BOM Items
if quantity > 0:
self.bom_items.append(BomItem(
part=self.part,
sub_part=sub_part,
quantity=quantity,
reference=' '.join(designators),
note="Wireviz BOM item"
))

# Write BOM data to database
self.save_bom_data()
Expand Down

0 comments on commit fba3408

Please sign in to comment.