summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-06-04 15:22:01 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-06-04 15:22:01 +0700
commit157f7756a24fd766429cbf639c732b76b18e9c26 (patch)
treeee41d03bdde03546e6932365b114c54776e10a7d /indoteknik_custom/models
parente846e6fef3274839e9f9b21984a753205d31970e (diff)
parent3882ee6c3299525eeb8924cd9c7245f65cd15a28 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into fix_bug_total_margin
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py6
-rw-r--r--indoteknik_custom/models/stock_picking.py1
2 files changed, 4 insertions, 3 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 21ca55eb..240289bf 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -816,7 +816,7 @@ class PurchaseOrder(models.Model):
for line in self.order_line:
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'):
+ if line.so_line_id.vendor_id.id != vendor_po:
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)+")",
@@ -834,7 +834,7 @@ 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:
self.env.user.notify_danger(
title='WARNING!!!',
message='Beda Margin dengan Sale Order',
@@ -1002,7 +1002,7 @@ class PurchaseOrder(models.Model):
self.approval_status_unlock = 'approvedFinance'
else:
raise UserError("Bisa langsung Confirm, menunggu persetujuan Finance jika ingin unlock PO")
- elif self.env.user.is_leader or self.env.user.has_group('indoteknik_custom.group_role_merchandiser'):
+ elif self.env.user.is_leader or self.env.user.has_group('indoteknik_custom.group_role_purchasing'):
raise UserError("Bisa langsung Confirm")
elif self.total_percent_margin == self.total_so_percent_margin and self.matches_so and not greater_than_plafon and not different_vendor_message:
raise UserError("Bisa langsung Confirm")
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index a215eb74..3921ed5a 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -584,6 +584,7 @@ class StockPicking(models.Model):
self.lalamove_phone = phone
self.lalamove_status = pod.get("status")
self.lalamove_delivered_at = delivered_at_dt
+ self.driver_arrival_date = delivered_at_dt
return data
raise UserError("No delivered data found in Lalamove response.")