From 7cbd5244480ead4450b8e6e646ecf939399a722c Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 3 Oct 2014 12:08:49 +0200 Subject: [PATCH 1/2] [FIX] ir_translation: apply tools.ustr on the trad itself tools.ustr(None) returns u'None', res[0] can be None. --- openerp/addons/base/ir/ir_translation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openerp/addons/base/ir/ir_translation.py b/openerp/addons/base/ir/ir_translation.py index f8eecc70856..0ff497e0274 100644 --- a/openerp/addons/base/ir/ir_translation.py +++ b/openerp/addons/base/ir/ir_translation.py @@ -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: From 9066da3369ddf36ffe187c0d199667070ac32be6 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 3 Oct 2014 12:09:48 +0200 Subject: [PATCH 2/2] [FIX] point_of_sale: do not display False as currency if symbol is not set --- addons/point_of_sale/static/src/js/widget_base.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/widget_base.js b/addons/point_of_sale/static/src/js/widget_base.js index 124be4e9f82..e69dd77e64d 100644 --- a/addons/point_of_sale/static/src/js/widget_base.js +++ b/addons/point_of_sale/static/src/js/widget_base.js @@ -33,9 +33,9 @@ function openerp_pos_basewidget(instance, module){ //module is instance.point_of amount = amount.toFixed(decimals); } if(this.currency.position === 'after'){ - return amount + ' ' + this.currency.symbol; + return amount + ' ' + (this.currency.symbol || ''); }else{ - return this.currency.symbol + ' ' + amount; + return (this.currency.symbol || '') + ' ' + amount; } }