2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 19:20:55 +00:00

Improve options for installing a part into another part

- Allow "variant" parts when the BOM specifies that variants are allowed for a particular BOM item
This commit is contained in:
Oliver
2021-11-10 11:11:52 +11:00
parent ab32ab0b3b
commit 6a534e0322
2 changed files with 24 additions and 3 deletions

View File

@ -560,9 +560,8 @@ class StockItemInstall(AjaxUpdateView):
# Filter for parts to install in this item
if self.install_item:
# Get parts used in this part's BOM
bom_items = self.part.get_bom_items()
allowed_parts = [item.sub_part for item in bom_items]
# Get all parts which can be installed into this part
allowed_parts = self.part.get_installed_part_options()
# Filter
items = items.filter(part__in=allowed_parts)