[17.0][FIX] stock_picking_report_valued: Respect global tax rounding method#490
Open
oscars8a wants to merge 3 commits into
Open
[17.0][FIX] stock_picking_report_valued: Respect global tax rounding method#490oscars8a wants to merge 3 commits into
oscars8a wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
The module was calculating picking tax amounts by always summing the
sale_price_tax field from each move line, regardless of the company's
tax_calculation_rounding_method setting. This caused discrepancies with
the related sale order when using global tax rounding (round_globally).
When round_globally is configured, sale.order calculates taxes on the
total base amount using account.tax._compute_taxes(), but the picking
was summing individual line taxes, leading to rounding differences.
Example:
I've recreated the example in Runboat.
https://www.awesomescreenshot.com/video/51310632?key=f816ff453f1917171dd799d033108b69
Sorry for my poor pronunciation
With Spanish accounting enabled, line discounts and global rounding selected.

In the Sale Order:
In the Delivery Slip Valued

Solution:
Modified StockPicking._compute_amount_all() to respect the company's
tax rounding configuration:
When tax_calculation_rounding_method is "round_globally": Uses the
same method as sale.order by calling account.tax._compute_taxes()
with all lines together, ensuring taxes match the sale order exactly.
When tax_calculation_rounding_method is "round_per_line": Keeps the
original behavior of summing sale_price_tax from each line.
This ensures picking amounts always match the related sale order totals,
regardless of the tax rounding method configured.