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 19:33
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

@smetl @antoine162 this PR targets master and is the last of the forward-port chain containing:

To merge the full chain, use

@robodoo r+

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

Copy link
Contributor

@smetl smetl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: #232207
Related: odoo/enterprise#97567
Signed-off-by: Antoine Dupuis (andu) <andu@odoo.com>
Signed-off-by: Laurent Smet (las) <las@odoo.com>
robodoo pushed a commit that referenced this pull request Oct 18, 2025
…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

closes #232207

X-original-commit: 5c19c3c
Related: odoo/enterprise#97567
Signed-off-by: Antoine Dupuis (andu) <andu@odoo.com>
Signed-off-by: Laurent Smet (las) <las@odoo.com>
@robodoo robodoo added the 19.1 label Oct 18, 2025
@robodoo robodoo closed this Oct 18, 2025
@fw-bot fw-bot deleted the master-18.0-fix-tax-rounding-las-471412-fw branch October 25, 2025 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

19.1 forwardport This PR was created by @fw-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants