[18.0][MIG] sale_order_report_hide_tax: migration to 18.0#350
[18.0][MIG] sale_order_report_hide_tax: migration to 18.0#350sabrinaRMartin wants to merge 4 commits intoOCA:18.0from
Conversation
c532c18 to
37cb5b3
Compare
chienandalu
left a comment
There was a problem hiding this comment.
Thanks for the tests. Some changes requested to improve them:
d95e5f3 to
9a92de5
Compare
Gelojr
left a comment
There was a problem hiding this comment.
The pull request is not approved. A review is requested.
Functional tests performed
The following functional tests have been executed and their results are correct:
Test 1: Hide tax column when all order lines share the same tax group — OK.
Test 2: Show tax column when different tax groups are used across order lines — OK.
Test 3: Ignore section and note lines when deciding tax column visibility — OK.
Test 4: Multiple taxes in the same tax group on a single line correctly hide the tax column — OK.
Test 6: Single order line with a single tax group behaves correctly — OK.
Test not passed
Test 5: Spanish localization with fiscal position adding withholding tax — NOT OK.
Steps to reproduce the issue
- Install and configure the Spanish localization.
- Use a Fiscal Position that applies a withholding tax (retención) in SO.
- Create a Sales Order for a customer and assign this Fiscal Position to the order.
- Add a product line with VAT 21% as the product tax.
- Verify that Odoo automatically adds the corresponding withholding tax to the sales order line due to the Fiscal Position.
- Print or preview the Sales Order / Quotation report.
Observed behavior
The tax column is not printed in the report, and taxes are not displayed, even though the order line contains taxes belonging to different tax groups (VAT and withholding).
Expected behavior
The tax column should be displayed in the report, since the sales order line includes taxes from different tax groups.
Based on the above, the pull request is not approved and a revision is requested to address this scenario.
@sabrinaRMartin please make a test for this and debug the reason why. At first glance, I'd say it should work, but it isn't. |
9a92de5 to
020779a
Compare
@chienandalu The problem arose because we were comparing one recordset with another, and it always returned the same values. In other words, for a line that has group A, B, the tax_group_id also returns group A, B, so the condition for displaying the column was not being met because first_line_tax_group and tax_group_id had the same value. |
|
@Gelojr @chienandalu could you please check the PR again? Everything should be working fine now. |
020779a to
8cbc119
Compare
|
@Gelojr when we have a single product line with taxes from different groups, so the column should not be displayed. For example:
Here the column should be displayed. B. The column is NOT displayed:
Here, the column should NOT be displayed. I will modify the README to make it clear how it works. |
Gelojr
left a comment
There was a problem hiding this comment.
Great work on this contribution @sabrinaRMartin. The functional behavior is well thought out and aligned with the goal of avoiding redundant information in the report.
The following tests have been executed to validate the module behavior after the latest changes:
- Test 1: Hide tax column when all order lines use taxes from the same tax group — OK
- Test 2: Show tax column when different tax groups are used across order lines — OK
- Test 3: Ignore section and note lines when evaluating tax groups — OK
- Test 4: When two taxes from different tax groups are applied on one line or across multiple lines, the tax column is still hidden as long as the tax groups are the same for the whole lines of the sale order (to avoid duplication with the tax summary). Example: Spanish localization fiscal position adds withholding tax (retención) consistently together with VAT — OK
- Test 5: Different taxes belonging to the same tax group on different lines correctly hide the tax column — OK
|
This PR has the |





Migration to 18.0
@moduon @chienandalu MT-13132
https://www.loom.com/share/d1e1d20059d544648aeb7f46a594b9ea