[FIX] tools: do not display False as the currency
The field symbol is not required on a res.currency (it should and will be changed in master). In case it is not set, do not display the currency in the rapport. Fixes #11346
This commit is contained in:
@@ -223,7 +223,7 @@ class rml_parse(object):
|
||||
return date.strftime(date_format.encode('utf-8'))
|
||||
|
||||
res = self.lang_dict['lang_obj'].format('%.' + str(digits) + 'f', value, grouping=grouping, monetary=monetary)
|
||||
if currency_obj:
|
||||
if currency_obj and currency_obj.symbol:
|
||||
if currency_obj.position == 'after':
|
||||
res = u'%s\N{NO-BREAK SPACE}%s' % (res, currency_obj.symbol)
|
||||
elif currency_obj and currency_obj.position == 'before':
|
||||
|
||||
@@ -1168,7 +1168,7 @@ def formatLang(env, value, digits=None, grouping=True, monetary=False, dp=False,
|
||||
|
||||
res = lang_obj.format('%.' + str(digits) + 'f', value, grouping=grouping, monetary=monetary)
|
||||
|
||||
if currency_obj:
|
||||
if currency_obj and currency_obj.symbol:
|
||||
if currency_obj.position == 'after':
|
||||
res = '%s %s' % (res, currency_obj.symbol)
|
||||
elif currency_obj and currency_obj.position == 'before':
|
||||
|
||||
Reference in New Issue
Block a user