summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-01-10 11:55:51 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-01-10 11:55:51 +0700
commitf80e95677fc8144e09830f619a08814928cf3fad (patch)
treeeb6710fe2ca1f54746d032d33141339f3ef5c2ec
parentae961c97d736359f6611db82ee484707f581ab0f (diff)
<Miqdad> matiin validasi approval pimpinan PO
-rwxr-xr-xindoteknik_custom/models/purchase_order.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index a114743f..7557045f 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -1079,18 +1079,18 @@ class PurchaseOrder(models.Model):
) % order.name)
def button_confirm(self):
- if self.env.user.id != 7 and not self.env.user.is_leader: # Pimpinan
- if '/PJ/' in self.name:
- price_change_detected = any(line.price_unit_before for line in self.order_line)
- if price_change_detected:
- if self.total_percent_margin <= 15.0:
- raise UserError("Approval Pimpinan diperlukan jika terdapat perubahan Unit Price pada PO Line dan Memiliki Margin <= 15%")
- else:
- low_margin_match_so = self.order_sales_match_line.filtered(
- lambda match: match.so_header_margin <= 15.0
- )
- if low_margin_match_so:
- raise UserError("Approval Pimpinan diperlukan jika pada PO Line yang Matches SO item memiliki header margin SO <= 15%")
+ # if self.env.user.id != 7 and not self.env.user.is_leader: # Pimpinan
+ # if '/PJ/' in self.name:
+ # price_change_detected = any(line.price_unit_before for line in self.order_line)
+ # if price_change_detected:
+ # if self.total_percent_margin <= 15.0:
+ # raise UserError("Approval Pimpinan diperlukan jika terdapat perubahan Unit Price pada PO Line dan Memiliki Margin <= 15%")
+ # else:
+ # low_margin_match_so = self.order_sales_match_line.filtered(
+ # lambda match: match.so_header_margin <= 15.0
+ # )
+ # if low_margin_match_so:
+ # raise UserError("Approval Pimpinan diperlukan jika pada PO Line yang Matches SO item memiliki header margin SO <= 15%")
# else:
# is_po_manual = '/A/' not in self.name and '/MO/' not in self.name
# if is_po_manual: