mirror of
https://github.com/inventree/InvenTree.git
synced 2025-11-13 19:36:46 +00:00
* BOM updates
- Allow variants of substititute parts to be allocated
- Closes https://github.com/inventree/InvenTree/issues/10606
* Check self.allow_variants
* Add comment
(cherry picked from commit a7c4f2adba)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
committed by
GitHub
parent
eb32546824
commit
486e338b0b
@@ -4271,6 +4271,11 @@ class BomItem(InvenTree.models.MetadataMixin, InvenTree.models.InvenTreeModel):
|
|||||||
for sub in self.substitutes.all():
|
for sub in self.substitutes.all():
|
||||||
parts.add(sub.part)
|
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 = []
|
valid_parts = []
|
||||||
|
|
||||||
for p in parts:
|
for p in parts:
|
||||||
|
|||||||
Reference in New Issue
Block a user