From 8dd456cb82d8fbcdcbcc3b7c1365360974f7078b Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 28 Feb 2019 15:15:29 +0000 Subject: [PATCH] [FIX] l10n_multilang: ensure order with record and template On some chart of accounts, some records (e.g. account.tax on l10n_be) have children and some are deactivated when the chart of account is created. The children on the account.tax and templates were not created in the same order The deactivated records were not found in the search. Before this commit the translations did not match the right record on the account.tax (e.g. 21% tax translated with a 12% name in Dutch) Bug noticed with avw closes odoo/odoo#31510 Signed-off-by: "Martin Trigaux (mat)" --- addons/l10n_multilang/models/l10n_multilang.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/addons/l10n_multilang/models/l10n_multilang.py b/addons/l10n_multilang/models/l10n_multilang.py index 4bde8505d5c..08ecb01a665 100644 --- a/addons/l10n_multilang/models/l10n_multilang.py +++ b/addons/l10n_multilang/models/l10n_multilang.py @@ -87,11 +87,20 @@ class AccountChartTemplate(models.Model): return self.process_translations(langs, field, in_ids, out_ids) def _get_template_from_model(self, company_id, model): + """ Find the records and their matching template """ + # genereated records have an external id with the format _