From a10ea93dbe5bbfcdc53f7ba46fd2b52ef6862a8f Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 9 Aug 2018 11:07:03 +0200 Subject: [PATCH] [FIX] account: rounding problem with Payment Matching in multi-currency Steps to reproduce: - activate the multi-currency option in the Accounting App - activate the EUR currency (USD being the base currency) - create a EUR Bank Journal with an EUR account - on 31/07 ==> rate = 1.1 - on 08/08 ==> rate = 1.2 - create a vendor bill for Asustek on 31/07 for 39794,40 EUR - create a vendor bill for Asustek on 31/07 for 61668,00 EUR - create a vendor bill for Asustek on 31/07 for 33487,70 EUR - create a supplier payment for Asustek for 134950,1 EUR - use the payment matching smart button - match the 3 invoices you entered; Bug: Odoo says there is an open balance to write-off and prevents you from reconciling Expected Behavior: the payment total amount in EUR matches the 3 vendor bills total amount in EUR so I would expect Odoo to consider I have a perfect match between the payment and the vendor bills and the difference in USD (base currency) should be automatically reflected through an exchange difference entry. if you follow the same operation with 3 invoices of 115EUR each and a payment of 345EUR, it will work as expected. opw:1872978 --- .../account/static/src/js/reconciliation/reconciliation_model.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/static/src/js/reconciliation/reconciliation_model.js b/addons/account/static/src/js/reconciliation/reconciliation_model.js index f76304e6908..c6e0bedb8ee 100644 --- a/addons/account/static/src/js/reconciliation/reconciliation_model.js +++ b/addons/account/static/src/js/reconciliation/reconciliation_model.js @@ -855,6 +855,7 @@ var StatementModel = BasicModel.extend({ } }); total = Math.round(total*1000)/1000 || 0; + amount_currency = Math.round(amount_currency); line.balance = { amount: total, amount_str: field_utils.format.monetary(Math.abs(total), {}, formatOptions),