From cd10bee519dc3cc86e4932cd2ea958f00e474011 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 23 Feb 2023 14:53:44 +0000 Subject: [PATCH] [FIX] transifex: still support old .tx/config format If one of the theme was not migrated to the new tx api, still support the previous notation. Happened on the design-theme repository closes odoo/odoo#113571 X-original-commit: a8355ba3dddb5f3c8a8e8e777aff85d558410971 Signed-off-by: Martin Trigaux (mat) --- addons/transifex/models/transifex_translation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/transifex/models/transifex_translation.py b/addons/transifex/models/transifex_translation.py index 6e60f347a20..59b4402445d 100644 --- a/addons/transifex/models/transifex_translation.py +++ b/addons/transifex/models/transifex_translation.py @@ -33,9 +33,13 @@ class TransifexTranslation(models.AbstractModel): ): if isfile(tx_path): tx_config_file.read(tx_path) - # tx_config_file.sections(): ['main', 'o:odoo:p:odoo-16:r:base', ...] for sec in tx_config_file.sections()[1:]: - _, _, _, tx_project, _, tx_mod = sec.split(':') + if len(sec.split(":")) != 6: + # old format ['main', 'odoo-16.base', ...] + tx_project, tx_mod = sec.split(".") + else: + # tx_config_file.sections(): ['main', 'o:odoo:p:odoo-16:r:base', ...] + _, _, _, tx_project, _, tx_mod = sec.split(':') projects[tx_mod] = tx_project return projects