From 10f15a4fafff9989df15b64a73c483af522c2d7c Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 9 Sep 2019 09:28:50 +0000 Subject: [PATCH] [FIX] l10n_multilang: ignore customized data conflict If you: - have a multilang COA - create an account.account manually - add a XML ID with structure {company_id}_{anything} manually - reload COA translations (install COA language, install COA, set installed COA since c346e7af3) => there is an error since the code try to copy translations of account.account.template associated to custom XML ID. fix: ignore this torcivous use case fixes #36310 opw-2063207 closes #36544 closes odoo/odoo#36659 X-original-commit: 0fc0b7484c48fbdcf549e199b5c8cabff3ab726c Signed-off-by: Nicolas Lempereur (nle) --- addons/l10n_multilang/models/l10n_multilang.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/l10n_multilang/models/l10n_multilang.py b/addons/l10n_multilang/models/l10n_multilang.py index 51ddb70c94c..8905c62d8f1 100644 --- a/addons/l10n_multilang/models/l10n_multilang.py +++ b/addons/l10n_multilang/models/l10n_multilang.py @@ -125,6 +125,9 @@ class AccountChartTemplate(models.Model): in_xml_ids = {xml_id.name: xml_id for xml_id in in_xml_ids} for name, xml_id in expected_in_xml_id_names.items(): + # ignore nonconforming customized data + if name not in in_xml_ids: + continue in_records += self.env[model + '.template'].browse(in_xml_ids[name].res_id) out_records += self.env[model].browse(xml_id.res_id)