summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-10-07 14:20:00 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-10-07 14:20:00 +0700
commitc67ec730efe048bce9872930841765d919956e15 (patch)
tree989f13e44c334e5d573e7261192528af392d24c5
parent55a7bd6000c93b19f70489e5393102854cceaa4b (diff)
cr confirm po
-rwxr-xr-xindoteknik_custom/models/purchase_order.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 8a47482a..ef2fdb5b 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -503,6 +503,9 @@ class PurchaseOrder(models.Model):
current_time = datetime.now()
self.check_ppn_mix()
# self.check_data_vendor()
+
+ if self.amount_untaxed >= 10000000 and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser'):
+ raise UserError("Hanya Merchandiser yang bisa approve")
if self.total_percent_margin < self.total_so_percent_margin and not self.env.user.is_purchasing_manager and not self.env.user.is_leader:
raise UserError("Beda Margin dengan Sales, harus approval Manager")
@@ -634,6 +637,8 @@ class PurchaseOrder(models.Model):
template.send_mail(self.id, force_send=True)
def po_approve(self):
+ if self.amount_untaxed >= 10000000 and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser'):
+ raise UserError("Hanya Merchandiser yang bisa approve")
if self.env.user.is_leader or self.env.user.is_purchasing_manager:
raise UserError("Bisa langsung Confirm")
elif self.total_percent_margin == self.total_so_percent_margin and self.sale_order_id: