From 2c19d2c78b3f1b8c3dc0c14556ceb8151ce04984 Mon Sep 17 00:00:00 2001 From: "John Laterre (jol)" Date: Tue, 12 Apr 2022 09:39:19 +0000 Subject: [PATCH] [FIX] account: trigger show_credit_limit on partner creation The Credit Limit group on the res.partner record doesn't appear until you save the record. This means you have to perform extra clicks if you want to edit this value. The goal is to show the `credit` field on the accounting tab on creation if `res.partner` is a company and Credit Limit setting is activated. task-2817650 closes odoo/odoo#88830 X-original-commit: 0ac5f58d4d4786a0b86bf0b71406d7d2c5d470bf Signed-off-by: Quentin De Paoli Signed-off-by: John Laterre --- addons/account/models/partner.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py index 726efcf956b..6325a1953bb 100644 --- a/addons/account/models/partner.py +++ b/addons/account/models/partner.py @@ -452,6 +452,7 @@ class ResPartner(models.Model): string='Partner Limit', groups='account.group_account_invoice,account.group_account_readonly', compute='_compute_use_partner_credit_limit', inverse='_inverse_use_partner_credit_limit') show_credit_limit = fields.Boolean( + default=lambda self: self.env.company.account_use_credit_limit, compute='_compute_show_credit_limit', groups='account.group_account_invoice,account.group_account_readonly') debit = fields.Monetary( compute='_credit_debit_get', search=_debit_search, string='Total Payable',