diff options
| author | Indoteknik . <it@fixcomart.co.id> | 2025-07-03 09:20:44 +0700 |
|---|---|---|
| committer | Indoteknik . <it@fixcomart.co.id> | 2025-07-03 09:20:44 +0700 |
| commit | 5a3c3d327dd04b3ec4f3c272e4bc50ab9c594058 (patch) | |
| tree | 83fe24873ccd5daf0b315f3e8a404232a5de5c50 | |
| parent | 4974971d68ad1e4f593059fa29155ff7f46ad753 (diff) | |
(andri) fix
| -rw-r--r-- | indoteknik_custom/models/res_partner.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/indoteknik_custom/models/res_partner.py b/indoteknik_custom/models/res_partner.py index 1e5cfd62..f5347bea 100644 --- a/indoteknik_custom/models/res_partner.py +++ b/indoteknik_custom/models/res_partner.py @@ -165,21 +165,21 @@ class ResPartner(models.Model): "this feature", tracking=3) telegram_id = fields.Char(string="Telegram") avg_aging= fields.Float(string='Average Aging') - payment_difficulty = fields.Selection([('bermasalah', 'Bermasalah'),('sulit', 'Sulit'),('agak_sulit', 'Agak Sulit'),('normal', 'Normal')], string='Payment Difficulty', compute="", inverse = "", tracking=3) + 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') - # @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 - - # def _inverse_payment_difficulty(self): - # for partner in self: - # if not partner.parent_id: - # partner.child_ids.write({ - # 'payment_difficulty': partner.payment_difficulty - # }) + @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 + + def _inverse_payment_difficulty(self): + for partner in self: + if not partner.parent_id: + partner.child_ids.write({ + 'payment_difficulty': partner.payment_difficulty + }) @api.model def _default_payment_term(self): |
