diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-02-17 15:05:04 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-02-17 15:05:04 +0700 |
| commit | 0d5eacd028aec65ada197a99e3b77e641f646bb2 (patch) | |
| tree | 1c44cce1d66634baef6b2a6c51b32a07b1e09f63 | |
| parent | 9bd46f112fdfb4fb7f56866b4e260efbd26c6daa (diff) | |
| parent | b2f39b75e96ef7c80f32ddd7cec86de1eb6c7279 (diff) | |
Merge branch 'odoo-production' into CR/tempo-renca
| -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)) |
