[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
This commit is contained in:
Goffin Simon
2017-03-30 14:42:52 +02:00
parent f60c18d832
commit b8ce0db8e1
@@ -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: