summaryrefslogtreecommitdiff
path: root/odoo/tools/translate.py
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2020-06-23 11:41:04 +0000
committerMartin Trigaux <mat@odoo.com>2020-06-30 08:53:29 +0000
commitd12813f7eec9d71be7573bf1dcaba9f8cf67eb79 (patch)
tree113cd08f0773930a7e23ecd9425d39c67b47bf16 /odoo/tools/translate.py
parent8add388db6339289439ed8baf7aad0828428461a (diff)
[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.
Diffstat (limited to 'odoo/tools/translate.py')
-rw-r--r--odoo/tools/translate.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/tools/translate.py b/odoo/tools/translate.py
index e98ad4e9b7a..b2bf929ec18 100644
--- a/odoo/tools/translate.py
+++ b/odoo/tools/translate.py
@@ -487,7 +487,7 @@ class GettextAlias(object):
finally:
if cr and is_new_cr:
cr.close()
- return res
+ return res or ''
@functools.total_ordering