Skip to content

Conversation

@fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Oct 17, 2025

== Fix bug price-included ==
Suppose a line of 24.99 with a 20% tax price-included.
base: 24.99 / 1.2 = 20.825
tax: 20.825 * 0.2 = 4.165
If we round both, we get 20.83 + 4.17 = 25.0 != 24.99

== Split and simplify round_base_line_tax_details ==
Easier implementation of this method to be easier to understand and
easier to be customized (see PT override). Also, we now use the
aggregate methods to aggregate the amounts instead of doing that by hand.

opw-4505888


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #232025
Forward-Port-Of: #228437

antoine162 and others added 2 commits October 17, 2025 17:55
At the moment, `_distribute_delta_amounts_smoothly` requires the factors
to be pre-nomalized. However, normalizing the factors robustly requires
more logic than just dividing by the sum of factors, especially if the
factors have different signs.

This commit moves the normalization into
`_distribute_delta_amounts_smoothly` itself meaning the calling code
doesn't need to take care of it anymore.

task-none

X-original-commit: 6c4133a
…ce-included

== Fix bug price-included ==
Suppose a line of 24.99 with a 20% tax price-included.
base: 24.99 / 1.2 = 20.825
tax: 20.825 * 0.2 = 4.165
If we round both, we get 20.83 + 4.17 = 25.0 != 24.99

== Split and simplify round_base_line_tax_details ==
Easier implementation of this method to be easier to understand and
easier to be customized (see PT override). Also, we now use the
aggregate methods to aggregate the amounts instead of doing that by hand.

opw-4505888

X-original-commit: 5c19c3c
@robodoo
Copy link
Contributor

robodoo commented Oct 17, 2025

Pull request status dashboard

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Oct 17, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Oct 17, 2025

This PR targets 19.0 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo
Copy link
Contributor

robodoo commented Oct 18, 2025

@smetl @antoine162 linked pull request(s) odoo/enterprise#97553 not ready. Linked PRs are not staged until all of them are ready.

robodoo pushed a commit that referenced this pull request Oct 18, 2025
At the moment, `_distribute_delta_amounts_smoothly` requires the factors
to be pre-nomalized. However, normalizing the factors robustly requires
more logic than just dividing by the sum of factors, especially if the
factors have different signs.

This commit moves the normalization into
`_distribute_delta_amounts_smoothly` itself meaning the calling code
doesn't need to take care of it anymore.

task-none

X-original-commit: 6c4133a
Part-of: #232186
Related: odoo/enterprise#97553
Signed-off-by: Antoine Dupuis (andu) <[email protected]>
Signed-off-by: Laurent Smet (las) <[email protected]>
@robodoo robodoo closed this in c0c0130 Oct 18, 2025
@fw-bot fw-bot deleted the 19.0-18.0-fix-tax-rounding-las-471137-fw branch October 25, 2025 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

forwardport This PR was created by @fw-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants