Fix import po file to convert res_id 0 into None

issue2531
This commit is contained in:
Cédric Krier committed 2012-04-09 17:46:55 +02:00
1 parent f90818931c
commit 8eaeecc12b
1 file changed
+7 -4
+7 -4
View File
@@ -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)