From 70dfadc9aa8274e8f9aafa4ec594af0b5a37343b Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Tue, 2 Sep 2025 12:00:26 +0700 Subject: (andri) add tracking payment terms dan fix notif ketika membuat SO --- indoteknik_custom/models/res_partner.py | 14 +++++++------- indoteknik_custom/views/sale_order.xml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/indoteknik_custom/models/res_partner.py b/indoteknik_custom/models/res_partner.py index 017be730..80fe643b 100644 --- a/indoteknik_custom/models/res_partner.py +++ b/indoteknik_custom/models/res_partner.py @@ -184,12 +184,12 @@ class ResPartner(models.Model): is_cbd_locked = fields.Boolean("Locked to CBD?", default=False, tracking=True, help="Jika dicentang, maka partner ini terkunci pada payment term CBD karena memiliki invoice yang sudah jatuh tempo lebih dari 30 hari.") # centang manual is_cbd_locked jika payment term diubah ke CBD - @api.onchange('is_cbd_locked') - def _onchange_is_cbd_locked(self): - if self.is_cbd_locked: - cbd_term = self.env['account.payment.term'].browse(26) - if cbd_term: - self.property_payment_term_id = cbd_term.id + # @api.onchange('is_cbd_locked') + # def _onchange_is_cbd_locked(self): + # if self.is_cbd_locked: + # cbd_term = self.env['account.payment.term'].browse(26) + # if cbd_term: + # self.property_payment_term_id = cbd_term.id @api.model def _default_payment_term(self): @@ -198,7 +198,7 @@ class ResPartner(models.Model): property_payment_term_id = fields.Many2one( 'account.payment.term', string='Payment Terms', - default=_default_payment_term + default=_default_payment_term, tracking=3 ) @api.depends("street", "street2", "city", "state_id", "country_id", "blok", "nomor", "rt", "rw", "kelurahan_id", diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 29d1a980..236a8b14 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -48,7 +48,7 @@ role="alert" style="height: 40px; margin-bottom:0px;" attrs="{'invisible':[('partner_is_cbd_locked','=',False)]}"> - Warning! Payment Terms Customer terkunci menjadi Cash Before Delivery (C.B.D.) karena ada invoice telah jatuh tempo 30 hari. Silakan ajukan Approval Payment Term untuk membuka kunci. + Warning! Payment Terms Customer terkunci menjadi Cash Before Delivery (C.B.D.) karena ada invoice telah jatuh tempo 30 hari. Silakan ajukan Approval Payment Term untuk membuka kunci.
-- cgit v1.2.3