From 3364f2236aeff794c000e6678856fdeeef08eae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 19 Sep 2021 00:34:38 +0200 Subject: [PATCH] Update only chart of account linked to a template issue10708 review343051004 --- account.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/account.py b/account.py index 55cfa916a1..8a6c29ae0f 100644 --- a/account.py +++ b/account.py @@ -2750,8 +2750,12 @@ class CreateChart(Wizard): class UpdateChartStart(ModelView): 'Update Chart' __name__ = 'account.update_chart.start' - account = fields.Many2One('account.account', 'Root Account', - required=True, domain=[('parent', '=', None)]) + account = fields.Many2One( + 'account.account', "Root Account", required=True, + domain=[ + ('parent', '=', None), + ('template', '!=', None), + ]) class UpdateChartSucceed(ModelView): @@ -2781,6 +2785,7 @@ class UpdateChart(Wizard): with Transaction().set_context(_check_access=True): charts = Account.search([ ('parent', '=', None), + ('template', '!=', None), ], limit=2) if len(charts) == 1: defaults['account'] = charts[0].id