summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-06-02 09:23:07 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-06-02 09:23:07 +0700
commit2bc522f12795bbd649d28fbc6f127df2ebac34ee (patch)
tree0dfebb75f458c738f63593313b0e19e917e85860 /indoteknik_custom/models/purchase_order.py
parent1a0b0cb4a740d831f69ea29943cfa0aed8e31fac (diff)
parent484b0e613d0d021faa11c619087baf36e4eacd09 (diff)
<hafid> fix email to Putra & Darren in pengajuan Tempo
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index cbfd4acd..21ca55eb 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
@@ -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
@@ -837,16 +841,16 @@ class PurchaseOrder(models.Model):
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 di confirm oleh Purchasing Manager")
send_email = False
if not self.not_update_purchasepricelist: