Fix for duplicating BOM

- Do not duplicate bom items which are "inherited"
This commit is contained in:
Oliver Walters 2021-02-18 00:38:40 +11:00
parent bf63005731
commit 8caf6bad10

View File

@ -1524,7 +1524,7 @@ class Part(MPTTModel):
# Copy existing BOM items from another part
# Note: Inherited BOM Items will *not* be duplicated!!
for bom_item in other.bom_items.all():
for bom_item in other.get_bom_items(include_inherited=False).all():
# If this part already has a BomItem pointing to the same sub-part,
# delete that BomItem from this part first!