2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 21:45:39 +00:00

Use 'on_order' count in calculation for parts we need to order

This commit is contained in:
Oliver Walters
2019-06-10 23:05:14 +10:00
parent 04a9b1a980
commit 3954b33fb7
3 changed files with 7 additions and 3 deletions

View File

@ -427,7 +427,7 @@ class Part(models.Model):
then we need to restock.
"""
return (self.total_stock - self.allocation_count) < self.minimum_stock
return (self.total_stock + self.on_order - self.allocation_count) < self.minimum_stock
@property
def can_build(self):
@ -816,6 +816,7 @@ class Part(models.Model):
return [order for order in self.purchase_orders() if order.status not in OrderStatus.OPEN]
@property
def on_order(self):
""" Return the total number of items on order for this part. """