From 34f09a0e69fccb4e9bdb53c02b2d9d69bcd8ca2c Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 10 May 2016 16:05:10 +0200 Subject: [PATCH] [FIX] base: no-break space in qweb A non-breaking space is used between the amount and the currency. However, if a space is used as a separator, there is a possibility that the amount will be split into several lines. opw-674535 --- openerp/addons/base/ir/ir_qweb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openerp/addons/base/ir/ir_qweb.py b/openerp/addons/base/ir/ir_qweb.py index f012cc8b139..2f0e73c26e5 100644 --- a/openerp/addons/base/ir/ir_qweb.py +++ b/openerp/addons/base/ir/ir_qweb.py @@ -887,7 +887,7 @@ class MonetaryConverter(osv.AbstractModel): lang = self.pool['res.lang'] formatted_amount = lang.format(cr, uid, [lang_code], fmt, Currency.round(cr, uid, display_currency, from_amount), - grouping=True, monetary=True) + grouping=True, monetary=True).replace(r' ', u'\N{NO-BREAK SPACE}') pre = post = u'' if display_currency.position == 'before': @@ -1049,7 +1049,7 @@ class QwebWidgetMonetary(osv.AbstractModel): lang_code = qwebcontext.context.get('lang') or 'en_US' formatted_amount = self.pool['res.lang'].format( qwebcontext.cr, qwebcontext.uid, [lang_code], fmt, inner, grouping=True, monetary=True - ) + ).replace(r' ', u'\N{NO-BREAK SPACE}') pre = post = u'' if display.position == 'before': pre = u'{symbol}\N{NO-BREAK SPACE}'