From ce3283f0ee32d9ed37d6b61c7461667d1104011c Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 4 Apr 2023 10:37:30 +0700 Subject: approval margin adjust to 22 --- indoteknik_custom/models/sale_order.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index fa5f3b6a..5c9266a0 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -291,7 +291,7 @@ class SaleOrder(models.Model): raise UserError(_('Isi Vendor, Harga Beli, dan Tax sebelum Request Approval')) if order.total_percent_margin <= 15 and not self.env.user.is_leader: raise UserError("Harus diapprove oleh Pimpinan") - elif order.total_percent_margin <= 25 and not self.env.user.is_leader and not self.env.user.is_sales_manager: + elif order.total_percent_margin <= 22 and not self.env.user.is_leader and not self.env.user.is_sales_manager: raise UserError("Harus diapprove oleh Manager") else: order.approval_status = 'approved' @@ -301,7 +301,7 @@ class SaleOrder(models.Model): def compute_total_margin(self): for order in self: - total_margin = total_percent_margin = sum_sales_price = 0 + total_margin = total_percent_margin = 0 for line in order.order_line: if not line.product_id: order.total_margin = 0 -- cgit v1.2.3