[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 <smetl@users.noreply.github.com>
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
Goffin Simon
2020-11-24 16:47:32 +00:00
parent bc67b1ab7b
commit f52b1655c1
+1 -1
View File
@@ -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