diff options
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 5 |
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: |
