diff options
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 0d2e42cb..2f3871ad 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -1067,9 +1067,14 @@ class SaleOrder(models.Model): if self.have_outstanding_invoice: raise UserError("Invoice harus di Cancel dahulu") + + disallow_states = ['draft', 'waiting', 'confirmed', 'assigned'] + for picking in self.picking_ids: + if picking.state in disallow_states: + raise UserError("DO yang draft, waiting, confirmed, atau assigned harus di-cancel oleh Logistik") for line in self.order_line: if line.qty_delivered > 0: - raise UserError("DO harus di-cancel terlebih dahulu.") + raise UserError("DO yang done harus di-Return oleh Logistik") if not self.web_approval: self.web_approval = 'company' |
