From aaf8203d44cb25782e5e18ed7d3fcc42032d7976 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 : 8.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 13c8490fb8..b599de9005 100644 --- a/trytond/trytond/ir/translation.py +++ b/trytond/trytond/ir/translation.py @@ -954,13 +954,15 @@ class Translation( 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