[IMP] tools: fallback on empty translation
Avoid returning False if, for any reason, the return is falsy (False, None,...) Following the discussion in odoo/odoo#53254, the root cause was a call in the form _(foo) where foo was equal False While nothing else than a string should be the argument of _, it's still technically possible to pass something else and get a bad return value. Fallback on empty string to be consistent.
This commit is contained in:
@@ -487,7 +487,7 @@ class GettextAlias(object):
|
||||
finally:
|
||||
if cr and is_new_cr:
|
||||
cr.close()
|
||||
return res
|
||||
return res or ''
|
||||
|
||||
|
||||
@functools.total_ordering
|
||||
|
||||
Reference in New Issue
Block a user