From c67ec730efe048bce9872930841765d919956e15 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Mon, 7 Oct 2024 14:20:00 +0700 Subject: cr confirm po --- indoteknik_custom/models/purchase_order.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indoteknik_custom/models/purchase_order.py') 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: -- cgit v1.2.3 From 53cb341f8184c3d74434f2b2d18d1bd984b57118 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 8 Oct 2024 09:06:49 +0700 Subject: cr po and validasi so --- indoteknik_custom/models/purchase_order.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indoteknik_custom/models/purchase_order.py') diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index ef2fdb5b..08408506 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -504,7 +504,7 @@ class PurchaseOrder(models.Model): 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'): + if self.amount_untaxed >= 50000000 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: @@ -637,7 +637,7 @@ 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'): + if self.amount_untaxed >= 50000000 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") -- cgit v1.2.3