diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-02-17 08:54:23 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-02-17 08:54:23 +0700 |
| commit | b2f39b75e96ef7c80f32ddd7cec86de1eb6c7279 (patch) | |
| tree | 6d5f6e9531fe6b9bb96373029f02bc15799ad7a8 | |
| parent | 78a7df26d09b64fb9b3b45084212cbf19c1907a1 (diff) | |
<iman> add logic if cbd not validasi limit
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 3 |
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)) |
