From 72c48efc9924c92545f54be5ffb7ade0011c397a Mon Sep 17 00:00:00 2001 From: william Date: Thu, 9 Apr 2020 10:01:40 +0000 Subject: [PATCH] [IMP] account: do not block user creation without CoA During the onboarding, if Invoicing is installed but no chart of account is set the field property_account_receivable_id and property_account_payable_id prevent from validating a new partner because they are required but not auto-filled, and the fields are not visible if Invoicing is not installed. closes odoo/odoo#49732 X-original-commit: 29c362b7c3353c2be11ab117f454d04ed9853f75 Signed-off-by: Quentin De Paoli (qdp) Signed-off-by: wan --- addons/account/models/partner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py index 115514677ca..ec747c56d88 100644 --- a/addons/account/models/partner.py +++ b/addons/account/models/partner.py @@ -404,12 +404,12 @@ class ResPartner(models.Model): string="Account Payable", domain="[('internal_type', '=', 'payable'), ('deprecated', '=', False), ('company_id', '=', current_company_id)]", help="This account will be used instead of the default one as the payable account for the current partner", - required=True) + required=lambda env: env.company.chart_template_id) property_account_receivable_id = fields.Many2one('account.account', company_dependent=True, string="Account Receivable", domain="[('internal_type', '=', 'receivable'), ('deprecated', '=', False), ('company_id', '=', current_company_id)]", help="This account will be used instead of the default one as the receivable account for the current partner", - required=True) + required=lambda env: env.company.chart_template_id) property_account_position_id = fields.Many2one('account.fiscal.position', company_dependent=True, string="Fiscal Position", domain="[('company_id', '=', current_company_id)]",