Allow duplicate BOM items when duplicating a part (#5347)

This commit is contained in:
Oliver 2023-07-26 16:47:59 +10:00 committed by GitHub
parent c614b78faf
commit 6660508326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2035,10 +2035,6 @@ class Part(InvenTreeBarcodeMixin, InvenTreeNotesMixin, MetadataMixin, MPTTModel)
if bom_item.part in my_ancestors and bom_item.inherited: if bom_item.part in my_ancestors and bom_item.inherited:
continue continue
# Skip if already exists
if BomItem.objects.filter(part=self, sub_part=bom_item.sub_part).exists():
continue
# Skip (or throw error) if BomItem is not valid # Skip (or throw error) if BomItem is not valid
if not bom_item.sub_part.check_add_to_bom(self, raise_error=raise_error): if not bom_item.sub_part.check_add_to_bom(self, raise_error=raise_error):
continue continue