From b8ce0db8e105ed3c9ab4aefe8bce5028764694f4 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 29 Mar 2017 22:38:36 +0200 Subject: [PATCH] [FIX] website_quote: translations for website_description When creating a SO with a quote template(QT), the website_description of the QT is transfered with the lang of the partner to the field website_description of sale.order model(in onchange_template_id on sale.order model). But when changing the partner_id on the SO, the lang of the new user was taken into account. opw:697893 --- addons/website_quote/models/sale_order.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/website_quote/models/sale_order.py b/addons/website_quote/models/sale_order.py index 54a5ac77287..d165cd67889 100644 --- a/addons/website_quote/models/sale_order.py +++ b/addons/website_quote/models/sale_order.py @@ -77,6 +77,14 @@ class SaleOrder(models.Model): total += line.price_subtotal + line.price_unit * ((line.discount or 0.0) / 100.0) * line.product_uom_qty # why is there a discount in a field named amount_undiscounted ?? self.amount_undiscounted = total + @api.onchange('partner_id') + def onchange_update_description_lang(self): + if not self.template_id: + return + else: + template = self.template_id.with_context(lang=self.partner_id.lang) + self.website_description = template.website_description + @api.onchange('template_id') def onchange_template_id(self): if not self.template_id: