From 978b8f64ece2a0c80002af0ee9cc81f032f2bbc2 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 19 Jul 2016 14:18:44 +0200 Subject: [PATCH] [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 --- addons/sale/sale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 351b6d0602f..1836f6a2fca 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -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