diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-05-06 16:52:44 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-05-06 16:52:44 +0700 |
| commit | e16dd5348125a7fc328052b177635282f931ccd9 (patch) | |
| tree | b68bcc04a05912026755147c6205dac2e9cb6edc | |
| parent | 2bb2ead5a6ee0a76a088f7e522cabc74ac8809be (diff) | |
fix logic ask cancel purchasing
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 2 |
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': |
