[FIX] fix import error message translation problem used tools.ustr() in error message.

bzr revid: ysa@tinyerp.com-20110520114221-u7uz2dzmaze532d4
This commit is contained in:
Yogesh (OpenERP) 2011-05-20 17:12:21 +05:30
parent 0c4e557129
commit 52442656f9
1 changed files with 4 additions and 3 deletions

View File

@ -838,14 +838,15 @@ class orm_template(object):
res = line[i] and float(line[i]) or 0.0
elif fields_def[field[len(prefix)]]['type'] == 'selection':
for key, val in fields_def[field[len(prefix)]]['selection']:
if line[i] in [tools.ustr(key), tools.ustr(val)]:
if tools.ustr(line[i]) in [tools.ustr(key), tools.ustr(val)]:
res = key
break
if line[i] and not res:
logger.notifyChannel("import", netsvc.LOG_WARNING,
_("key '%s' not found in selection field '%s'") % \
(line[i], field[len(prefix)]))
warning += [_("Key/value '%s' not found in selection field '%s'") % (line[i], field[len(prefix)])]
( tools.ustr(line[i]), tools.ustr(field[len(prefix)])))
warning += [_("Key/value '%s' not found in selection field '%s'") % (tools.ustr(line[i]), tools.ustr(field[len(prefix)]))]
else:
res = line[i]