[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) <jol@odoo.com>
This commit is contained in:
Atul Patel
2024-04-24 07:55:46 +00:00
parent 1e12160f12
commit aef0498f2a
+2
View File
@@ -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']}