diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2017-11-15 10:44:20 +0100 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2017-11-15 12:57:19 +0100 |
| commit | a9beee42d652de63edb0b2153b3028447e4eff03 (patch) | |
| tree | a8eae5e7cb0babc2a3895d17b4a4624f9610e215 | |
| parent | 0a775adda8a081706cb4ff757b22ad1d92476d3e (diff) | |
[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`.
| -rw-r--r-- | odoo/tools/misc.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/tools/misc.py b/odoo/tools/misc.py index ca20ab3278b..6233f4572b1 100644 --- a/odoo/tools/misc.py +++ b/odoo/tools/misc.py @@ -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) |
