Daily updates from Odoo
Friday, July 26, 2024
1 change · saas-17.2
Resolved issues and error corrections
Invoice totals are now calculated more consistently when taxes are included in prices and global rounding is used. This prevents small rounding differences from changing the untaxed amount, keeping invoice totals aligned with the sum of individual lines.
Original PR description
In case you have 2 invoice lines of 21.53 with 21% price included taxes, the code will compute 21.53 / 1.21 * 2 ~= 35.59 as untaxed amount, 7.47 as tax amount and 40.06 as total amount. However, for now, we decided we want to put the rounding into the tax amount instead of making an adjustment on the untaxed amount because we want the untaxed amount being the sum of the price excluded amount of each line. Here, 2 * round(21.53 / 1.21) = 35.58. So we are forced to put the rounding on the tax instead to have 35.58 + 7.48 = 43.06 and then, round like the round_per_line when the tax is price included. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr