[FIX] tools: lang in formatLang
- Install French language - Set language of Customer A to French - Create an invoice due in the past - Open the Customer Statements The customer statement of A is translated in French, but the amounts are formatted in the company's user language (English by default). We add the possiblity to take into account the lang in the context when calling `formatLang`.
This commit is contained in:
+1
-1
@@ -1175,7 +1175,7 @@ def formatLang(env, value, digits=None, grouping=True, monetary=False, dp=False,
|
||||
if isinstance(value, (str, unicode)) and not value:
|
||||
return ''
|
||||
|
||||
lang = env.user.company_id.partner_id.lang or 'en_US'
|
||||
lang = env.context.get('lang') or env.user.company_id.partner_id.lang or 'en_US'
|
||||
lang_objs = env['res.lang'].search([('code', '=', lang)])
|
||||
if not lang_objs:
|
||||
lang_objs = env['res.lang'].search([], limit=1)
|
||||
|
||||
Reference in New Issue
Block a user