summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 701c0a3f..51517437 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -1074,8 +1074,10 @@ class PurchaseOrder(models.Model):
low_margin_lines = self.order_sales_match_line.filtered(
lambda match: match.so_header_margin <= 15.0
)
- if low_margin_lines:
- raise UserError("Matches SO terdapat item dengan header margin SO <= 15%. Approval Pimpinan diperlukan.")
+ price_change_detected = any(line.price_unit_before for line in self.order_line)
+ if low_margin_lines and price_change_detected:
+ # raise UserError("Matches SO terdapat item dengan header margin SO <= 15%. Approval Pimpinan diperlukan.")
+ raise UserError("Approval Pimpinan diperlukan jika terdapat perubahan Unit Price 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: