diff options
| author | Indoteknik . <it@fixcomart.co.id> | 2025-07-07 08:26:38 +0700 |
|---|---|---|
| committer | Indoteknik . <it@fixcomart.co.id> | 2025-07-07 08:26:38 +0700 |
| commit | 54633b0db570e5811874f78a9515065b9cb41ad8 (patch) | |
| tree | 8d560522f2fd0e44577452e21dedc4b779e01e05 | |
| parent | 8837ae450af891898efd790e908d87664d2dd910 (diff) | |
(andri) payment diff res partner no compute
| -rw-r--r-- | indoteknik_custom/models/res_partner.py | 13 | ||||
| -rw-r--r-- | indoteknik_custom/views/res_partner.xml | 19 |
2 files changed, 16 insertions, 16 deletions
diff --git a/indoteknik_custom/models/res_partner.py b/indoteknik_custom/models/res_partner.py index f5347bea..33c01f37 100644 --- a/indoteknik_custom/models/res_partner.py +++ b/indoteknik_custom/models/res_partner.py @@ -168,12 +168,17 @@ class ResPartner(models.Model): payment_difficulty = fields.Selection([('bermasalah', 'Bermasalah'),('sulit', 'Sulit'),('agak_sulit', 'Agak Sulit'),('normal', 'Normal')], string='Payment Difficulty', compute="_compute_payment_difficulty", inverse = "_inverse_payment_difficulty", tracking=3) payment_history_url = fields.Text(string='Payment History URL') + # no compute + payment_diff = fields.Selection([('bermasalah', 'Bermasalah'),('sulit', 'Sulit'),('agak_sulit', 'Agak Sulit'),('normal', 'Normal')], string='Payment Difficulty', tracking=3) + + # tidak terpakai @api.depends('parent_id.payment_difficulty') def _compute_payment_difficulty(self): for partner in self: if partner.parent_id: partner.payment_difficulty = partner.parent_id.payment_difficulty + # tidak terpakai def _inverse_payment_difficulty(self): for partner in self: if not partner.parent_id: @@ -210,8 +215,8 @@ class ResPartner(models.Model): rec._update_address_from_coords() # Sinkronisasi payment_difficulty ke semua anak jika partner ini adalah parent - if not rec.parent_id and 'payment_difficulty' in vals: - rec.child_ids.write({'payment_difficulty': vals['payment_difficulty']}) + if not rec.parent_id and 'payment_diff' in vals: + rec.child_ids.write({'payment_diff': vals['payment_diff']}) # # # if 'property_payment_term_id' in vals: # # if not self.env.user.is_accounting and vals['property_payment_term_id'] != 26: @@ -230,8 +235,8 @@ class ResPartner(models.Model): for rec in records: if vals.get('latitude') and vals.get('longtitude'): rec._update_address_from_coords() - if rec.parent_id and not vals.get('payment_difficulty'): - rec.payment_difficulty = rec.parent_id.payment_difficulty + if rec.parent_id and not vals.get('payment_diff'): + rec.payment_diff = rec.parent_id.payment_diff return records @api.constrains('name') diff --git a/indoteknik_custom/views/res_partner.xml b/indoteknik_custom/views/res_partner.xml index ac4d0364..0a2c0377 100644 --- a/indoteknik_custom/views/res_partner.xml +++ b/indoteknik_custom/views/res_partner.xml @@ -108,13 +108,6 @@ <xpath expr="//field[@name='property_supplier_payment_term_id']" position="attributes"> <attribute name="readonly">1</attribute> </xpath> - <xpath expr="//notebook/page[@name='accounting']" position="inside"> - <group string="Aging Info"> - <field name="avg_aging" readonly="1"/> - <field name="payment_difficulty" attrs="{'readonly': [('parent_id', '!=', False)]}" /> - <field name="payment_history_url" readonly="1" /> - </group> - </xpath> <notebook> <page string="Pengajuan Tempo"> <!-- Informasi Usaha Section --> @@ -188,11 +181,6 @@ <field name="dokumen_pengiriman_input"/> <field name="dokumen_invoice"/> </group> - <!-- <group string="Aging Info"> - <field name="avg_aging" readonly="1"/> - <field name="payment_difficulty" attrs="{'readonly': [('parent_id', '!=', False)]}" /> - <field name="payment_history_url" readonly="1" /> - </group> --> </group> <!-- Supplier Lines Section --> @@ -225,6 +213,13 @@ <field name="dokumen_ktp_dirut" /> </group> </page> + <page string="Aging Info"> + <group string="Aging Info"> + <field name="avg_aging" readonly="1"/> + <field name="payment_diff" attrs="{'readonly': [('parent_id', '!=', False)]}" /> + <field name="payment_history_url" readonly="1" /> + </group> + </page> </notebook> </field> </record> |
