2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-15 03:25:42 +00:00

Split display of purchase orders by company view

This commit is contained in:
Oliver Walters
2019-06-10 22:43:09 +10:00
parent b8bcc5ce0c
commit c132f275f5
4 changed files with 28 additions and 42 deletions

View File

@ -135,6 +135,16 @@ class Company(models.Model):
""" Return purchase orders which are 'outstanding' """
return self.purchase_orders.filter(status__in=OrderStatus.OPEN)
def closed_purchase_orders(self):
""" Return purchase orders which are not 'outstanding'
- Complete
- Failed / lost
- Returned
"""
return self.purchase_orders.exclude(status__in=OrderStatus.OPEN)
def complete_purchase_orders(self):
return self.purchase_orders.filter(status=OrderStatus.COMPLETE)