diff options
| author | Nasreddin (bon) <bon@odoo.com> | 2020-06-23 09:22:31 +0000 |
|---|---|---|
| committer | Nasreddin (bon) <bon@odoo.com> | 2020-06-24 11:06:01 +0000 |
| commit | 3c169a415b2f5155479af03f791fbf97d438231d (patch) | |
| tree | baf5bc7ab82f3bfa3d38dccd625ddff2f12dc973 /odoo/tools/misc.py | |
| parent | c219727974558f0656a4e16c186c9b05d9f2581b (diff) | |
[FIX] tools: Return input_str when removing accents if empty
Issue
The misc feature remove_accents(input_str) return a
string 'False' if the param is a boolean.
Solution
Return input_str if equal '' or False.
opw-2278959
closes odoo/odoo#53572
X-original-commit: 3fc7ce3b5599355933734e5e3f59d14a7a9b199c
Related: odoo/enterprise#11391
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Diffstat (limited to 'odoo/tools/misc.py')
| -rw-r--r-- | odoo/tools/misc.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/odoo/tools/misc.py b/odoo/tools/misc.py index e7f087f1636..e1dc069cddb 100644 --- a/odoo/tools/misc.py +++ b/odoo/tools/misc.py @@ -754,6 +754,8 @@ def remove_accents(input_str): """Suboptimal-but-better-than-nothing way to replace accented latin letters by an ASCII equivalent. Will obviously change the meaning of input_str and work only for some cases""" + if not input_str: + return input_str input_str = ustr(input_str) nkfd_form = unicodedata.normalize('NFKD', input_str) return u''.join([c for c in nkfd_form if not unicodedata.combining(c)]) |
