From 0bb2dd5c3eb0d251e483e7c2ccd1b4720634e33f Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 10 Nov 2022 14:38:56 +1100 Subject: [PATCH] Bug fix for PurchaseOrder template (#3913) * Bug fix for PurchaseOrder template - PurchaseOrder.is_pending method did not exist - Thus was evaluating to "false" in the template * UI fixes --- InvenTree/order/models.py | 5 +++++ InvenTree/order/templates/order/order_base.html | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/InvenTree/order/models.py b/InvenTree/order/models.py index 22faccf380..1645817b20 100644 --- a/InvenTree/order/models.py +++ b/InvenTree/order/models.py @@ -380,6 +380,11 @@ class PurchaseOrder(Order): trigger_event('purchaseorder.completed', id=self.pk) + @property + def is_pending(self): + """Return True if the PurchaseOrder is 'pending'""" + return self.status == PurchaseOrderStatus.PENDING + @property def is_overdue(self): """Returns True if this PurchaseOrder is "overdue". diff --git a/InvenTree/order/templates/order/order_base.html b/InvenTree/order/templates/order/order_base.html index 5ffb6bcd7e..057d53aad1 100644 --- a/InvenTree/order/templates/order/order_base.html +++ b/InvenTree/order/templates/order/order_base.html @@ -58,8 +58,8 @@ {% if order.status == PurchaseOrderStatus.PENDING %} - {% elif order.status == PurchaseOrderStatus.PLACED %}