diff --git a/InvenTree/order/models.py b/InvenTree/order/models.py
index 1c59a0bb31..756f185c32 100644
--- a/InvenTree/order/models.py
+++ b/InvenTree/order/models.py
@@ -479,6 +479,11 @@ class PurchaseOrder(TotalPriceMixin, Order):
"""Return True if the PurchaseOrder is 'pending'"""
return self.status == PurchaseOrderStatus.PENDING
+ @property
+ def is_open(self):
+ """Return True if the PurchaseOrder is 'open'"""
+ return self.status in PurchaseOrderStatus.OPEN
+
def can_cancel(self):
"""A PurchaseOrder can only be cancelled under the following circumstances.
@@ -813,9 +818,9 @@ class SalesOrder(TotalPriceMixin, Order):
if self.lines.count() == 0:
raise ValidationError(_('Order cannot be completed as no parts have been assigned'))
- # Only a PENDING order can be marked as SHIPPED
- elif self.status != SalesOrderStatus.PENDING:
- raise ValidationError(_('Only a pending order can be marked as complete'))
+ # Only an open order can be marked as shipped
+ elif not self.is_open:
+ raise ValidationError(_('Only an open order can be marked as complete'))
elif self.pending_shipment_count > 0:
raise ValidationError(_("Order cannot be completed as there are incomplete shipments"))
diff --git a/InvenTree/order/templates/order/order_base.html b/InvenTree/order/templates/order/order_base.html
index 08da68fa42..aafe96d1c0 100644
--- a/InvenTree/order/templates/order/order_base.html
+++ b/InvenTree/order/templates/order/order_base.html
@@ -57,11 +57,11 @@
{% endif %}
-{% if order.status == PurchaseOrderStatus.PENDING %}
+{% if order.is_pending %}
-{% elif order.status == PurchaseOrderStatus.PLACED %}
+{% elif order.is_open %}