2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-10-21 08:27:38 +00:00

BOM updates (#10611)

* BOM updates

- Allow variants of substititute parts to be allocated
- Closes https://github.com/inventree/InvenTree/issues/10606

* Check self.allow_variants

* Add comment
This commit is contained in:
Oliver
2025-10-18 11:49:46 +11:00
committed by GitHub
parent c731de2b05
commit a7c4f2adba

View File

@@ -4271,6 +4271,11 @@ class BomItem(InvenTree.models.MetadataMixin, InvenTree.models.InvenTreeModel):
for sub in self.substitutes.all():
parts.add(sub.part)
# Account for variants of the substitute part (if allowed)
if allow_variants and self.allow_variants:
for sub_variant in sub.part.get_descendants(include_self=False):
parts.add(sub_variant)
valid_parts = []
for p in parts: