summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2024-10-16 15:47:07 +0700
committerstephanchrst <stephanchrst@gmail.com>2024-10-16 15:47:07 +0700
commit8914f55dba0a2d4a1e992c9d0635ae993950bcf1 (patch)
treef41be6b8474db4f61e0122c68614a191829e39cf /indoteknik_custom/models/purchase_order.py
parentd7f4569c5d2dcda1316ca4ef37fed53f467df9df (diff)
parenta1b2542ebc2d527d07edbcbaab467152a46f1d33 (diff)
Merge branch 'production' into feature/generate_url
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 340df49e..f8af409f 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -508,11 +508,11 @@ class PurchaseOrder(models.Model):
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:
- raise UserError("Beda Margin dengan Sales, harus approval Manager")
+ if self.total_percent_margin < self.total_so_percent_margin and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser') and not self.env.user.is_leader:
+ raise UserError("Beda Margin dengan Sales, harus approval Merchandise")
if not self.from_apo:
- if not self.sale_order_id and not self.env.user.is_purchasing_manager and not self.env.user.is_leader:
- raise UserError("Tidak ada link dengan SO, harus approval Manager")
+ if not self.sale_order_id and self.env.user.has_group('indoteknik_custom.group_role_merchandiser') and not self.env.user.is_leader:
+ raise UserError("Tidak ada link dengan SO, harus approval Merchandise")
send_email = False
self.add_product_to_pricelist()
@@ -641,7 +641,7 @@ class PurchaseOrder(models.Model):
def po_approve(self):
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:
+ if self.env.user.is_leader or self.env.user.has_group('indoteknik_custom.group_role_merchandiser'):
raise UserError("Bisa langsung Confirm")
elif self.total_percent_margin == self.total_so_percent_margin and self.sale_order_id:
raise UserError("Bisa langsung Confirm")