From 121f5f732fc837e1f8b801eaaed038962aa574fd Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 27 May 2025 09:54:41 +0700 Subject: notif diffrent vendor so and po --- indoteknik_custom/models/purchase_order.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (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 cbfd4acd..36c4c7b9 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -817,7 +817,11 @@ class PurchaseOrder(models.Model): if not line.so_line_id: continue if line.so_line_id.vendor_id.id != vendor_po and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser'): - raise UserError("Produk "+line.product_id.name+" memiliki vendor berbeda dengan SO (Vendor PO: "+str(self.partner_id.name)+", Vendor SO: "+str(line.so_line_id.vendor_id.name)+")") + self.env.user.notify_danger( + title='WARNING!!!', + message="Produk "+line.product_id.name+" memiliki vendor berbeda dengan SO (Vendor PO: "+str(self.partner_id.name)+", Vendor SO: "+str(line.so_line_id.vendor_id.name)+")", + sticky=True + ) def button_confirm(self): # self._check_payment_term() # check payment term -- cgit v1.2.3 From 755f6efe380cbbdd05ba592f651ca87030a22143 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 27 May 2025 10:57:24 +0700 Subject: fix api shipment group --- 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 36c4c7b9..2513f8fd 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -849,8 +849,8 @@ class PurchaseOrder(models.Model): ) if not self.from_apo: - if not self.matches_so and not 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") + if not self.matches_so and not self.env.user.id == 21: + raise UserError("Tidak ada link dengan SO, harus approval Rafly") send_email = False if not self.not_update_purchasepricelist: -- cgit v1.2.3 From 660d79ee317460e79a61287bda7d7a8e8b423b48 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 27 May 2025 11:00:46 +0700 Subject: push --- 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 2513f8fd..53037703 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -808,8 +808,8 @@ class PurchaseOrder(models.Model): # test = line.product_uom_qty # test2 = line.product_id.plafon_qty # test3 = test2 + line.product_uom_qty - if line.product_uom_qty > line.product_id.plafon_qty + line.product_uom_qty and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser'): - raise UserError('Product '+line.product_id.name+' melebihi plafon, harus Approval MD') + if line.product_uom_qty > line.product_id.plafon_qty + line.product_uom_qty and not self.env.user.id == 21: + raise UserError('Product '+line.product_id.name+' melebihi plafon, harus Approval Rafly') def check_different_vendor_so_po(self): vendor_po = self.partner_id.id -- cgit v1.2.3 From c2c8fff66b2aab1fa034fc2b6a12ebb9b4f9fbc6 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Wed, 28 May 2025 11:26:42 +0700 Subject: fixed approval by purchasing manager if not linked with sales order request by rafly hanggara --- indoteknik_custom/models/purchase_order.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 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 36c4c7b9..b08dcf62 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -834,23 +834,23 @@ class PurchaseOrder(models.Model): if self.amount_untaxed >= 50000000 and not self.env.user.id == 21: raise UserError("Hanya Rafly Hanggara yang bisa approve") - 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: + if self.total_percent_margin < self.total_so_percent_margin and not self.env.user.is_leader: self.env.user.notify_danger( title='WARNING!!!', message='Beda Margin dengan Sale Order', sticky=True ) - if len(self.order_sales_match_line) == 0 and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser') and not self.env.user.is_leader: - self.env.user.notify_danger( - title='WARNING!!!', - message='Tidak ada matches SO', - sticky=True - ) + # if len(self.order_sales_match_line) == 0 and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser') and not self.env.user.is_leader: + # self.env.user.notify_danger( + # title='WARNING!!!', + # message='Tidak ada matches SO', + # sticky=True + # ) if not self.from_apo: - if not self.matches_so and not 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") + if not self.matches_so and not self.env.user.is_purchasing_manager and not self.env.user.is_leader: + raise UserError("Tidak ada link dengan SO, harus approval Purchasing Manager") send_email = False if not self.not_update_purchasepricelist: -- cgit v1.2.3 From cf4b57fe825ae3522b7d893344eb9649c7bd10b3 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Wed, 28 May 2025 13:13:44 +0700 Subject: add purchasing manager as approval manufacturing order while confirm --- indoteknik_custom/models/purchase_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 d6b449fd..21ca55eb 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -850,7 +850,7 @@ class PurchaseOrder(models.Model): if not self.from_apo: if not self.matches_so and not self.env.user.is_purchasing_manager and not self.env.user.is_leader: - raise UserError("Tidak ada link dengan SO, harus approval Purchasing Manager") + raise UserError("Tidak ada link dengan SO, harus di confirm oleh Purchasing Manager") send_email = False if not self.not_update_purchasepricelist: -- cgit v1.2.3