From f52b1655c1ad72085017153ccaf4451910d7c975 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 23 Nov 2020 14:01:01 +0000 Subject: [PATCH] [FIX] sale: Wrong lang in terms and conditions Steps to reproduce the bug: - Let's consider a configuration with two languages L1 and L2 - Go to Settings / Accounting / Customer Invoice / Default term & condition - Define a default text T1 and save - Create a new customer invoice, T1 is displayed in the field narration - Go to Settings / Accounting / Customer Invoice / Default term & condition - Change T1 to T2 for L1, L2 and save - Create a new customer invoice Bug: T2 was displayed in the field narration opw:2388353 closes odoo/odoo#62270 X-original-commit: 98d36b80ed1b4f11491301d3b7b5818d81edf542 Signed-off-by: Laurent Smet Signed-off-by: Simon Goffin (sig) --- addons/sale/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/account_invoice.py b/addons/sale/models/account_invoice.py index 6b66727c58b..c0d5319ab9a 100644 --- a/addons/sale/models/account_invoice.py +++ b/addons/sale/models/account_invoice.py @@ -53,7 +53,7 @@ class AccountMove(models.Model): # Recompute 'narration' based on 'company.invoice_terms'. if self.move_type == 'out_invoice': - self.narration = self.company_id.with_context(lang=self.partner_id.lang).invoice_terms + self.narration = self.company_id.with_context(lang=self.partner_id.lang or self.env.lang).invoice_terms return res