2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-01-28 09:03:41 +00:00

[bug] Fix "can_build" quantity (#11185)

- Ignore virtual parts when considering "can_build" quantity
- Closes https://github.com/inventree/InvenTree/issues/11182
This commit is contained in:
Oliver
2026-01-22 12:14:35 +11:00
committed by GitHub
parent 00c36e9366
commit 64acdd6ccf

View File

@@ -1625,8 +1625,8 @@ class Part(
if not self.has_bom: if not self.has_bom:
return 0 return 0
# Prefetch related tables, to reduce query expense # Ignore virtual parts when calculating the "can_build" quantity
queryset = self.get_bom_items() queryset = self.get_bom_items(include_virtual=False)
# Ignore 'consumable' BOM items for this calculation # Ignore 'consumable' BOM items for this calculation
queryset = queryset.filter(consumable=False) queryset = queryset.filter(consumable=False)