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
This commit is contained in:
Oliver 2022-11-10 14:38:56 +11:00 committed by GitHub
parent 57a20be5c3
commit 0bb2dd5c3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -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".

View File

@ -58,8 +58,8 @@
</ul>
</div>
{% if order.status == PurchaseOrderStatus.PENDING %}
<button type='button' class='btn btn-outline-secondary' id='place-order' title='{% trans "Place order" %}'>
<span class='fas fa-paper-plane icon-blue'></span>
<button type='button' class='btn btn-primary' id='place-order' title='{% trans "Submit Order" %}'>
<span class='fas fa-paper-plane'></span> {% trans "Submit Order" %}
</button>
{% elif order.status == PurchaseOrderStatus.PLACED %}
<button type='button' class='btn btn-primary' id='receive-order' title='{% trans "Receive items" %}'>