mirror of
https://github.com/inventree/InvenTree.git
synced 2026-01-28 17:13:44 +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:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user