diff options
| author | AndriFP <113114423+andrifp@users.noreply.github.com> | 2025-09-11 10:45:58 +0700 |
|---|---|---|
| committer | AndriFP <113114423+andrifp@users.noreply.github.com> | 2025-09-11 10:45:58 +0700 |
| commit | d27561901fa2f0ab7534f255351e82459c6a531e (patch) | |
| tree | ebef94b2e82d2299b6142f487ae894bb3f0a60b0 | |
| parent | 32d0ca72aa38701747794dab06e7fb98b6f31489 (diff) | |
(andri) fix
| -rw-r--r-- | indoteknik_custom/models/res_partner.py | 8 | ||||
| -rw-r--r-- | indoteknik_custom/views/res_partner.xml | 2 | ||||
| -rwxr-xr-x | indoteknik_custom/views/sale_order.xml | 2 |
3 files changed, 2 insertions, 10 deletions
diff --git a/indoteknik_custom/models/res_partner.py b/indoteknik_custom/models/res_partner.py index 0c932dbe..36570e8f 100644 --- a/indoteknik_custom/models/res_partner.py +++ b/indoteknik_custom/models/res_partner.py @@ -194,14 +194,6 @@ class ResPartner(models.Model): default=_default_payment_term, tracking=3 ) - @api.constrains('property_payment_term_id', 'is_cbd_locked') - def _check_cbd_lock_partner(self): - # cbd_term = self.env['account.payment.term'].browse(26) - for rec in self: - if rec.is_cbd_locked: - raise ValidationError( - "Partner ini terkunci ke CBD, hanya boleh pakai Payment Term CBD." - ) @api.depends("street", "street2", "city", "state_id", "country_id", "blok", "nomor", "rt", "rw", "kelurahan_id", "kecamatan_id") diff --git a/indoteknik_custom/views/res_partner.xml b/indoteknik_custom/views/res_partner.xml index 7541df35..7d5be3b7 100644 --- a/indoteknik_custom/views/res_partner.xml +++ b/indoteknik_custom/views/res_partner.xml @@ -108,7 +108,7 @@ <field name="reminder_invoices"/> </xpath> <xpath expr="//field[@name='property_payment_term_id']" position="attributes"> - <attribute name="readonly">0</attribute> + <attribute name="readonly">1</attribute> </xpath> <xpath expr="//field[@name='property_supplier_payment_term_id']" position="attributes"> <attribute name="readonly">1</attribute> diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 236a8b14..5f1a6117 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -47,7 +47,7 @@ <div class="alert alert-danger" role="alert" style="height: 40px; margin-bottom:0px;" - attrs="{'invisible':[('partner_is_cbd_locked','=',False)]}"> + attrs="{'invisible':['|', ('partner_is_cbd_locked','=',False), ('state', 'not in', ['draft', 'cancel'])]}"> <strong>Warning!</strong> Payment Terms Customer terkunci menjadi <b>Cash Before Delivery (C.B.D.)</b> karena ada invoice telah jatuh tempo <b>30 hari</b>. Silakan ajukan <b>Approval Payment Term</b> untuk membuka kunci. </div> </xpath> |
