summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriFP <andrifebriyadiputra@gmail.com>2025-04-28 09:43:02 +0700
committerAndriFP <andrifebriyadiputra@gmail.com>2025-04-28 09:43:02 +0700
commita2a05e1183f9829b09d2e065815cb3618cc05049 (patch)
tree1b95b4b205ba5b114a028be681092681ba4aafc7
parent6dfa0b1ec5c9fd60f2adee26b7dbb1de3aea5302 (diff)
(andri) rev fix margin approval untuk 1 Mei
-rwxr-xr-xindoteknik_custom/models/sale_order.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 02d61387..ab63509b 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -1451,11 +1451,13 @@ class SaleOrder(models.Model):
due_extension.unlink()
return False
+ # Rule: # ≤ 15% → Pimpinan, > 15% - <24% → Manager, == 24% → Langsung Confirm
def _requires_approval_margin_leader(self):
- return self.total_percent_margin < 15 and not self.env.user.is_leader
+ return self.total_percent_margin <= 15 and not self.env.user.is_leader
def _requires_approval_margin_manager(self):
- return self.total_percent_margin >= 15 and not self.env.user.is_leader and not self.env.user.is_sales_manager
+ return 15 < self.total_percent_margin <= 24 and not self.env.user.is_sales_manager and not self.env.user.is_leader
+ # return self.total_percent_margin >= 15 and not self.env.user.is_leader and not self.env.user.is_sales_manager
def _create_approval_notification(self, approval_role):
title = 'Warning'