From 35b36176673b9bba83474cf8cbca0e8f69cda751 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Tue, 18 Jul 2017 18:51:28 +0200 Subject: [PATCH] [FIX] account: payment onchange in multi currencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Computation of the field 'Difference amount' was wrong as it was converting amounts in base currency in the following use case: - company currency USD - invoice currency EUR - payment's journal currency USD but payment's currency EUR - invoice of 100€, payment of 20€: difference was not 80€ because it was converting to USD --- addons/account/models/account_payment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index b75f87354df..580c654aa89 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -91,7 +91,7 @@ class account_abstract_payment(models.AbstractModel): total = 0 for inv in self.invoice_ids: if inv.currency_id == payment_currency: - total += inv.residual_company_signed + total += inv.residual_signed else: total += inv.company_currency_id.with_context(date=self.payment_date).compute( inv.residual_company_signed, payment_currency)