summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-05-06 16:52:44 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-05-06 16:52:44 +0700
commite16dd5348125a7fc328052b177635282f931ccd9 (patch)
treeb68bcc04a05912026755147c6205dac2e9cb6edc
parent2bb2ead5a6ee0a76a088f7e522cabc74ac8809be (diff)
fix logic ask cancel purchasing
-rwxr-xr-xindoteknik_custom/models/sale_order.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 0d86019e..f99058ea 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -1497,7 +1497,7 @@ class SaleOrder(models.Model):
def action_cancel(self):
# TODO stephan prevent cancel if have invoice, do, and po
- if self.state_ask_cancel != 'approve':
+ if self.state_ask_cancel != 'approve' and self.state not in ['draft', 'sent']:
raise UserError("Anda harus approval purchasing terlebih dahulu")
main_parent = self.partner_id.get_main_parent()
if self._name != 'sale.order':