summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorFIN-IT_AndriFP <it@fixcomart.co.id>2025-10-01 15:10:10 +0700
committerFIN-IT_AndriFP <it@fixcomart.co.id>2025-10-01 15:10:10 +0700
commitc04dd5a6a38ba35b30a39ed6596514679067e541 (patch)
treea5795fd6006e222dc53ff664ef85ecb0e27c6352 /indoteknik_custom/models/purchase_order.py
parent6adb1cb5fe8dbe85b971dc1cad476718f24c38cb (diff)
(andri) add so header margin pada matches SO + fix
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index a76cdab1..1a88d036 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -1072,10 +1072,10 @@ class PurchaseOrder(models.Model):
if self.env.user.id != 7: # Pimpinan
if '/PJ/' in self.name:
low_margin_lines = self.order_sales_match_line.filtered(
- lambda match: match.sale_line_id.item_percent_margin <= 34.0
+ lambda match: match.so_header_margin <= 34.0
)
if low_margin_lines:
- raise UserError("Matches SO terdapat item dengan margin SO <= 15%. Approval Pimpinan diperlukan.")
+ raise UserError("Matches SO terdapat item dengan header margin SO <= 15%. Approval Pimpinan diperlukan.")
else:
is_po_manual = '/A/' not in self.name and '/MO/' not in self.name
if is_po_manual: