From 4315779e55328bbad48dfc199b9ded5f7562060f Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 19 Oct 2015 15:44:03 +0200 Subject: [PATCH] [FIX] account: invoice in foreign currency When creating an invoice in a foreign currency, and adding a line with a product, the `onchange` failed, due to the fact the field `date_invoice` is not on the invoice line, but on the invoice. --- addons/account/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 0649343db0b..98af54bdaa4 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1131,7 +1131,7 @@ class AccountInvoiceLine(models.Model): if company.currency_id != currency: if type in ('in_invoice', 'in_refund'): self.price_unit = product.standard_price - self.price_unit = self.price_unit * currency.with_context(dict(self._context or {}, date=self.date_invoice)).rate + self.price_unit = self.price_unit * currency.with_context(dict(self._context or {}, date=self.invoice_id.date_invoice)).rate if self.uom_id and self.uom_id.id != product.uom_id.id: self.price_unit = self.env['product.uom']._compute_price(