Forward port of branch saas-3 up to fc9fc3e
[odoo/odoo.git] / openerp / addons / base / ir / ir_translation.py
index 8e20a83..9e0dd5e 100644 (file)
@@ -20,6 +20,7 @@
 ##############################################################################
 
 import logging
+import unicodedata
 
 from openerp import tools
 import openerp.modules
@@ -351,7 +352,8 @@ class ir_translation(osv.osv):
         trad = res and res[0] or u''
         if source and not trad:
             return tools.ustr(source)
-        return trad
+        # Remove control characters
+        return filter(lambda c: unicodedata.category(c) != 'Cc', tools.ustr(trad))
 
     def create(self, cr, uid, vals, context=None):
         if context is None: