mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-03 13:58:47 +00:00
allocatedItems function now takes variants into account
This commit is contained in:
parent
9baf856d75
commit
ee9df039cb
@ -881,9 +881,12 @@ class Build(MPTTModel):
|
|||||||
output - Build output (StockItem).
|
output - Build output (StockItem).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Remember, if 'variant' stock is allowed to be allocated, it becomes more complicated!
|
||||||
|
variants = part.get_descendants(include_self=True)
|
||||||
|
|
||||||
allocations = BuildItem.objects.filter(
|
allocations = BuildItem.objects.filter(
|
||||||
build=self,
|
build=self,
|
||||||
stock_item__part=part,
|
stock_item__part__pk__in=[p.pk for p in variants],
|
||||||
install_into=output,
|
install_into=output,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user