summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-04-04 10:37:30 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-04-04 10:37:30 +0700
commitce3283f0ee32d9ed37d6b61c7461667d1104011c (patch)
treeb88c08da2048c378fb3c2fb1a48086f28e14b892
parent2a0a2ba14501a6becdc7655d8924bfdc1123877e (diff)
approval margin adjust to 22
-rwxr-xr-xindoteknik_custom/models/sale_order.py4
1 files 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