[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:
parent
6d4e1cc73e
commit
7cbd524448
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue