summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindoteknik_custom/models/sale_order.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 9631fe6e..8a851a69 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -942,6 +942,7 @@ class SaleOrder(models.Model):
# Ambil blocking stage dari partner
block_stage = rec.partner_id.parent_id.blocking_stage if rec.partner_id.parent_id else rec.partner_id.blocking_stage or 0
+ is_cbd = rec.partner_id.parent_id.property_payment_term_id.id == 26 if rec.partner_id.parent_id else rec.partner_id.property_payment_term_id.id == 26 or False
# Ambil jumlah nilai dari SO yang invoice_status masih 'to invoice'
so_to_invoice = 0
@@ -952,7 +953,7 @@ class SaleOrder(models.Model):
remaining_credit_limit = block_stage - current_total - so_to_invoice
# Validasi limit
- if remaining_credit_limit <= 0 and block_stage > 0:
+ if remaining_credit_limit <= 0 and block_stage > 0 and not is_cbd:
raise UserError(_("The credit limit for %s will exceed the Blocking Stage if the Sale Order is confirmed. The remaining credit limit is %s, from %s and the outstanding amount is %s.")
% (rec.partner_id.name, block_stage - current_total, block_stage, outstanding_amount))