[FIX] sale: onchange on 'note' in a sale order

When website_quote is installed, the Terms and Conditions of the quote
template should replace the Terms and Conditions of the company.
But if T&C of the company is not filled, it will keep the note written.

opw:683543
This commit is contained in:
Goffin Simon
2016-07-19 14:36:50 +02:00
parent 02d686f9e1
commit 978b8f64ec
+2 -1
View File
@@ -207,8 +207,9 @@ class SaleOrder(models.Model):
'payment_term_id': self.partner_id.property_payment_term_id and self.partner_id.property_payment_term_id.id or False,
'partner_invoice_id': addr['invoice'],
'partner_shipping_id': addr['delivery'],
'note': self.with_context(lang=self.partner_id.lang).env.user.company_id.sale_note,
}
if self.env.user.company_id.sale_note:
values['note'] = self.with_context(lang=self.partner_id.lang).env.user.company_id.sale_note
if self.partner_id.user_id:
values['user_id'] = self.partner_id.user_id.id