[FIX] ir_translation: apply tools.ustr on the trad itself

tools.ustr(None) returns u'None', res[0] can be None.
This commit is contained in:
Denis Ledoux 2014-10-03 12:08:49 +02:00
parent 6d4e1cc73e
commit 7cbd524448
1 changed files with 2 additions and 2 deletions

View File

@ -336,11 +336,11 @@ class ir_translation(osv.osv):
AND name=%s""",
(lang or '', types, tools.ustr(name)))
res = cr.fetchone()
trad = res and tools.ustr(res[0]) or u''
trad = res and res[0] or u''
if source and not trad:
return tools.ustr(source)
# Remove control characters
return filter(lambda c: unicodedata.category(c) != 'Cc', trad)
return filter(lambda c: unicodedata.category(c) != 'Cc', tools.ustr(trad))
def create(self, cr, uid, vals, context=None):
if context is None: