mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Change SalesOrder.can_cancel() (#4544)
* Change SalesOrder.can_cancel() * fix
This commit is contained in:
parent
08d0084e07
commit
d0f9d0d830
@ -868,14 +868,11 @@ class SalesOrder(TotalPriceMixin, Order):
|
||||
|
||||
def can_cancel(self):
|
||||
"""Return True if this order can be cancelled."""
|
||||
if self.status != SalesOrderStatus.PENDING:
|
||||
return False
|
||||
|
||||
return True
|
||||
return self.is_open
|
||||
|
||||
@transaction.atomic
|
||||
def cancel_order(self):
|
||||
"""Cancel this order (only if it is "pending").
|
||||
"""Cancel this order (only if it is "open").
|
||||
|
||||
Executes:
|
||||
- Mark the order as 'cancelled'
|
||||
|
Loading…
Reference in New Issue
Block a user