From 65e9e2bb3886b5275263a3b9ffce7c04757da26d Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 13 Sep 2022 14:06:10 +0700 Subject: add produk sementara validation --- indoteknik_custom/models/sale_order.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 6f901809..08349bd3 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -46,6 +46,13 @@ class SaleOrder(models.Model): # self.approval_status = False # return super(SaleOrder, self).action_cancel() + def action_confirm(self): + for line in self.order_line: + if line.product_id.id == 232383: + raise UserError(_('Tidak bisa Confirm menggunakan Produk Sementara')) + res = super(SaleOrder, self).action_confirm() + return res + def compute_total_margin(self): for order in self: total_margin = total_percent_margin = 0 -- cgit v1.2.3