From 9bf1f97d9bfa2128f36a103fbb8aa671a91b5417 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 12 Apr 2018 10:10:43 +0200 Subject: [PATCH] [FIX] sale: Translation issue on T&C on Invoices The sale_note field is translated according to the language of the customer in a SO. This fix applies the same behavior on the customer invoice. Inspired from this commit: 978b8f64ece2a0c80002af0ee9cc81f032f2bbc2 opw:1830838 --- addons/sale/models/account_invoice.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/sale/models/account_invoice.py b/addons/sale/models/account_invoice.py index a26b39a3b15..49c3805902a 100644 --- a/addons/sale/models/account_invoice.py +++ b/addons/sale/models/account_invoice.py @@ -39,6 +39,9 @@ class AccountInvoice(models.Model): def _onchange_delivery_address(self): addr = self.partner_id.address_get(['delivery']) self.partner_shipping_id = addr and addr.get('delivery') + if self.env.context.get('type', 'out_invoice') == 'out_invoice': + company = self.company_id or self.env.user.company_id + self.comment = company.with_context(lang=self.partner_id.lang).sale_note @api.multi def action_invoice_paid(self):