From 6e1161e2ee6a5ffb14d2c3a24b696a89e0fba840 Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Thu, 10 Jan 2019 13:35:19 +0000 Subject: [PATCH] [FIX] account: translate invoce line desc opw-1922531 Before this commit, the product's description for customers was not translated in the invoice. Now, the product's description for customers is translated in the invoice. closes odoo/odoo#30107 --- addons/account/models/account_invoice.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 1f88ad9b2e2..69a7443f3da 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1712,17 +1712,17 @@ class AccountInvoiceLine(models.Model): self.price_unit = 0.0 domain['uom_id'] = [] else: + self_lang = self if part.lang: - product = self.product_id.with_context(lang=part.lang) - else: - product = self.product_id - + self_lang = self.with_context(lang=part.lang) + + product = self_lang.product_id account = self.get_invoice_line_account(type, product, fpos, company) if account: self.account_id = account.id self._set_taxes() - product_name = self._get_invoice_line_name_from_product() + product_name = self_lang._get_invoice_line_name_from_product() if product_name != None: self.name = product_name