From 2ecbfddd6bf877c8fe1221e6bda6b88c4c3417ea Mon Sep 17 00:00:00 2001 From: "jerome hanke (jhk)" Date: Thu, 23 Jan 2020 13:23:28 +0000 Subject: [PATCH] [FIX] sale: context lang used on product variants display name Steps to reproduce: - install sales and contact - install another language - go to contacts, pick a specific contact and set its language to the new language installed - go to sales > settings > activate the "product configurator" option - create a product with a translated variant (the variant has to have at least 2 translated attributes with custom values) - create a quotation with the modified contact and the product with the variant (use the product configurator wizard) > save - print that quotation Previous behavior: product description is not fully translated the part describing the variants is in the current user's language while the product display_name is using the associated partner's language Current behavior: product description is fully translated into the correct language opw-2168102 closes odoo/odoo#44144 X-original-commit: 4a542cbd3655b7058ff4dd22feaeb18c6d3ec510 Signed-off-by: Nicolas Martinelli (nim) --- addons/sale/models/sale.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 81c2dfa7995..b4e1f313f5d 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -1675,10 +1675,10 @@ class SaleOrderLine(models.Model): # display the no_variant attributes, except those that are also # displayed by a custom (avoid duplicate description) for ptav in (no_variant_ptavs - custom_ptavs): - name += "\n" + ptav.display_name + name += "\n" + ptav.with_context(lang=self.order_id.partner_id.lang).display_name # display the is_custom values for pacv in self.product_custom_attribute_value_ids: - name += "\n" + pacv.display_name + name += "\n" + pacv.with_context(lang=self.order_id.partner_id.lang).display_name return name