From 7d2d1f7c481fd051932080b9db929a790435be6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Mon, 29 Jan 2024 18:47:56 +0100 Subject: [PATCH] Skip translation refering to unknown XML ID or unactivated source Closes #12969 (grafted from 563cb007e55c30ed03e3fb4eb74b623bfa8fd6e1) --HG-- branch : 7.0 --- trytond/trytond/ir/translation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/trytond/trytond/ir/translation.py b/trytond/trytond/ir/translation.py index b9b62dc8b3..9cb67d7052 100644 --- a/trytond/trytond/ir/translation.py +++ b/trytond/trytond/ir/translation.py @@ -856,13 +856,15 @@ class Translation(ModelSQL, ModelView): if (model in fs_id2prop and res_id in fs_id2prop[model]): res_id, noupdate = fs_id2prop[model][res_id] + elif res_id: + continue if res_id: try: res_id = int(res_id) except ValueError: - res_id = None - if not res_id: + continue + else: res_id = -1 translation.res_id = res_id