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

Calculate parts on order for a Part / SupplierPart

This commit is contained in:
Oliver Walters
2019-06-07 08:37:25 +10:00
parent 4af1f6ca9f
commit 31ad31365a
4 changed files with 46 additions and 11 deletions

View File

@ -806,6 +806,11 @@ class Part(models.Model):
return orders
def on_order(self):
""" Return the total number of items on order for this part. """
return sum([part.on_order() for part in self.supplier_parts.all()])
def attach_file(instance, filename):
""" Function for storing a file for a PartAttachment