From 8eaeecc12b798cab4618eca005104b3a6499ebd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 9 Apr 2012 17:46:55 +0200 Subject: [PATCH] Fix import po file to convert res_id 0 into None issue2531 --- trytond/ir/translation.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/trytond/ir/translation.py b/trytond/ir/translation.py index 9dea4a90a1..4ef0c9e05e 100644 --- a/trytond/ir/translation.py +++ b/trytond/ir/translation.py @@ -515,10 +515,13 @@ class Translation(ModelSQL, ModelView, Cacheable): res_id = model_data.db_id noupdate = model_data.noupdate - try: - res_id = int(res_id) - except ValueError: - continue + if res_id: + try: + res_id = int(res_id) + except ValueError: + continue + if not res_id: + res_id = None if ttype in ('odt', 'view', 'wizard_button', 'selection', 'error'): key = (name, res_id, ttype, src)