[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
This commit is contained in:
Goffin Simon
2018-08-09 13:43:38 +02:00
parent 908ddbfeb7
commit a10ea93dbe
@@ -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),