[FIX] base: inactive lang
Make sure to retrieve the lang in case it is inactive. Note that a lang cannot be deactivated if it is set on a `res.users`, but no check if performed on a `res.partner`. opw-1964655 closes odoo/odoo#32457 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -115,7 +115,7 @@ class Currency(models.Model):
|
||||
fractional_value = int(parts[2] or 0)
|
||||
|
||||
lang_code = self.env.context.get('lang') or self.env.user.lang
|
||||
lang = self.env['res.lang'].search([('code', '=', lang_code)])
|
||||
lang = self.env['res.lang'].with_context(active_test=False).search([('code', '=', lang_code)])
|
||||
amount_words = tools.ustr('{amt_value} {amt_word}').format(
|
||||
amt_value=_num2words(integer_value, lang=lang.iso_code),
|
||||
amt_word=self.currency_unit_label,
|
||||
|
||||
Reference in New Issue
Block a user