[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) <nle@odoo.com>
This commit is contained in:
Nicolas Lempereur
2019-09-10 19:04:53 +00:00
committed by fw-bot
parent 9e30276556
commit 10f15a4faf
@@ -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)