From 0fa8e3809e34c1d24c8483a4e012b254fbc58b78 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 15 Jun 2019 15:33:03 +1000 Subject: [PATCH] Limit PO selection to only those which are PENDING --- InvenTree/company/models.py | 4 ++++ InvenTree/order/templates/order/order_wizard/select_pos.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/InvenTree/company/models.py b/InvenTree/company/models.py index 68e9cbaf9b..9d09557f17 100644 --- a/InvenTree/company/models.py +++ b/InvenTree/company/models.py @@ -135,6 +135,10 @@ class Company(models.Model): """ Return purchase orders which are 'outstanding' """ return self.purchase_orders.filter(status__in=OrderStatus.OPEN) + def pending_purchase_orders(self): + """ Return purchase orders which are PENDING (not yet issued) """ + return self.purchase_orders.filter(status=OrderStatus.PENDING) + def closed_purchase_orders(self): """ Return purchase orders which are not 'outstanding' diff --git a/InvenTree/order/templates/order/order_wizard/select_pos.html b/InvenTree/order/templates/order/order_wizard/select_pos.html index f97ba95ee2..4ae0a89c95 100644 --- a/InvenTree/order/templates/order/order_wizard/select_pos.html +++ b/InvenTree/order/templates/order/order_wizard/select_pos.html @@ -53,7 +53,7 @@ id='id-purchase-order-{{ supplier.id }}' name='purchase-order-{{ supplier.id }}'> - {% for order in supplier.outstanding_purchase_orders %} + {% for order in supplier.pending_purchase_orders %}