From 5dc3710a5008cbbd3d2e6cbc1fca12bc0bd31eda Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Wed, 24 Sep 2025 13:29:15 +0700 Subject: (andri) fix validasi --- indoteknik_custom/models/sale_order.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 85f0d274..f80941d2 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -423,13 +423,13 @@ class SaleOrder(models.Model): @api.constrains('payment_term_id', 'partner_id', 'state') def _check_cbd_lock_sale_order(self): - # cbd_term = self.env['account.payment.term'].browse(26) + cbd_term = self.env['account.payment.term'].browse(26) for rec in self: if rec.state == 'draft' and rec.partner_id.is_cbd_locked: - # if rec.payment_term_id and rec.payment_term_id != cbd_term: - raise ValidationError( - "Customer ini terkunci ke CBD, hanya boleh pakai Payment Term CBD." - ) + if rec.payment_term_id and rec.payment_term_id != cbd_term: + raise ValidationError( + "Customer ini terkunci ke CBD, hanya boleh pakai Payment Term CBD." + ) @api.depends('invoice_ids.payment_state', 'invoice_ids.amount_total', 'invoice_ids.amount_residual') def _compute_payment_state_custom(self): -- cgit v1.2.3