From 8caf6bad1057e7a59cdcf7b16ace3cb29e732297 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 18 Feb 2021 00:38:40 +1100 Subject: [PATCH] Fix for duplicating BOM - Do not duplicate bom items which are "inherited" --- InvenTree/part/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index 911a2cdac4..06e0c9f078 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -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!