From aef0498f2a87c31faf243782447b57e7dff96295 Mon Sep 17 00:00:00 2001 From: Atul Patel Date: Tue, 9 Apr 2024 09:51:55 +0000 Subject: [PATCH] [FIX] account: avoid override of accounts custom reconcile setting In some databases, customers have changed the `reconcile` value of an account from its standard `False` value to `True`. This action causes related journal items, which are partially reconciled, to raise the following constraint error. during the upgrade process: ``` You cannot switch an account to prevent the reconciliation if some partial reconciliations are still pending ``` so we delete changes in the `reconcile` values from the reload to avoid overriding user customer setting & triggering the constraint error. closes odoo/odoo#163020 X-original-commit: 0a4bd1e6d4b76d113b30d2b19fee8408c0988d93 Signed-off-by: John Laterre (jol) --- addons/account/models/chart_template.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index 440b1518a14..c5110e26c21 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -348,6 +348,8 @@ class AccountChartTemplate(models.AbstractModel): }]) account = existing_account + # Prevents overriding user setting & raising a partial reconcile error. + values.pop('reconcile', None) # on existing accounts, only tag_ids are to be updated using default data if account and 'tag_ids' in data[model_name][xmlid]: data[model_name][xmlid] = {'tag_ids': data[model_name][xmlid]['tag_ids']}