Friday, August 15, 2025
1 change · saas-18.2
Resolved issues and error corrections
This update corrects how payment reconciliations are calculated when an invoice and payment use the same foreign currency but have small rounding differences. It prevents duplicate exchange adjustment entries that were not properly connected to the reconciliation, improving accounting accuracy and traceability.
Original PR description
After https://github.com/odoo/odoo/pull/204746, in some situations we will default the amount of the partial on residual of debit aml even if this one is larger than the credit aml amount. This lead to multiple exchange moves creation that are not properly linked to the reconciliation chain. Steps to reproduce: 1/ Setup foreign currency with rate 0.648587 (ex 0.648587 USD = 1 AUD for AUD company) 2/ Create invoice with lines 36 USD (55.51 AUD) -7.2 USD (-11.1 AUD) => Receivable will be 28.8 USD (44.41 AUD) because it's computed from sum of above lines 3/ Register a payment of 28.8 USD (44.4 AUD) => Two exchange moves will be created with 0.01 in credit, none of them is in a partial with the invoice or payment line This PR makes sure that we take the smallest amount of residual if both credit and debit are considered as fully matched. opw-4835254 Forward-Port-Of: odoo/odoo#219237