New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FW][FIX] account: compute tax ordering #156024
Closed
fw-bot
wants to merge
1
commit into
odoo:saas-16.1
from
odoo-dev:saas-16.1-17.0-opw-3691765-account_compute_tax_ordering-ilru-zkcc-fw
Closed
[FW][FIX] account: compute tax ordering #156024
fw-bot
wants to merge
1
commit into
odoo:saas-16.1
from
odoo-dev:saas-16.1-17.0-opw-3691765-account_compute_tax_ordering-ilru-zkcc-fw
Conversation
This file contains 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
**Issue Description**: Currently, the order in which taxes are applied can vary based on the sequence they are entered in the invoice's Taxes field. This inconsistency arises when the tax list is not manually adjusted, leading to each tax having an identical sequence value. As a result, their hierarchy within the `flatten_taxes_hierarchy` function is determined by their input order rather than a defined sequence, causing unpredictable tax calculations. https://github.com/odoo/odoo/blob/56666f8f7858fcbcce466d2240135b35509d2d96/addons/account/models/account_tax.py#L611-L632 A tax sequence should be explicitly defined, and in cases where sequences are identical, organization by tax ID should be enforced. **Steps to Reproduce**: 1. Navigate to the `Account` or `Invoice` application. 2. Go to `Configuration > Taxes`. 3. Create a new tax with the advanced option `Affect Base of Subsequent Taxes` and specify an amount. 4. Generate a new invoice and add a line item priced at 100. 5. Apply taxes in the `Taxes` column in the following order: 15% followed by the newly created tax, and note the total amount. 6. Repeat step 5, but reverse the order of the taxes. 7. Observe that the total amounts differ between the two sequences. **Proposed Solution**: To ensure that taxes are applied consistently regardless of input order, we will modify the `flatten_taxes_hierarchy` function to add sorting by id. If the sequences are identical, the sorting will depend only on the id, otherwise it will be based on the sequence. This setting ensures a predictable and logical process for applying taxes. opw-3691765 X-original-commit: 516c471
This PR targets saas-16.1 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 r+ |
robodoo
pushed a commit
that referenced
this pull request
Mar 4, 2024
**Issue Description**: Currently, the order in which taxes are applied can vary based on the sequence they are entered in the invoice's Taxes field. This inconsistency arises when the tax list is not manually adjusted, leading to each tax having an identical sequence value. As a result, their hierarchy within the `flatten_taxes_hierarchy` function is determined by their input order rather than a defined sequence, causing unpredictable tax calculations. https://github.com/odoo/odoo/blob/56666f8f7858fcbcce466d2240135b35509d2d96/addons/account/models/account_tax.py#L611-L632 A tax sequence should be explicitly defined, and in cases where sequences are identical, organization by tax ID should be enforced. **Steps to Reproduce**: 1. Navigate to the `Account` or `Invoice` application. 2. Go to `Configuration > Taxes`. 3. Create a new tax with the advanced option `Affect Base of Subsequent Taxes` and specify an amount. 4. Generate a new invoice and add a line item priced at 100. 5. Apply taxes in the `Taxes` column in the following order: 15% followed by the newly created tax, and note the total amount. 6. Repeat step 5, but reverse the order of the taxes. 7. Observe that the total amounts differ between the two sequences. **Proposed Solution**: To ensure that taxes are applied consistently regardless of input order, we will modify the `flatten_taxes_hierarchy` function to add sorting by id. If the sequences are identical, the sorting will depend only on the id, otherwise it will be based on the sequence. This setting ensures a predictable and logical process for applying taxes. opw-3691765 closes #156024 X-original-commit: 516c471 Signed-off-by: Laurent Smet (las) <las@odoo.com> Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
fw-bot
deleted the
saas-16.1-17.0-opw-3691765-account_compute_tax_ordering-ilru-zkcc-fw
branch
March 18, 2024 13:46
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Issue Description:
Currently, the order in which taxes are applied can vary based on the sequence they are entered in the invoice's Taxes field. This inconsistency arises when the tax list is not manually adjusted, leading to each tax having an identical sequence value. As a result, their hierarchy within the
flatten_taxes_hierarchy
function is determined by their input order rather than a defined sequence, causing unpredictable tax calculations.odoo/addons/account/models/account_tax.py
Lines 611 to 632 in 56666f8
A tax sequence should be explicitly defined, and in cases where sequences are identical, organization by tax ID should be enforced.
Steps to Reproduce:
Account
orInvoice
app.Configuration > Taxes
.Affect Base of Subsequent Taxes
and specify an amount.Taxes
column in the following order: 15% followed by the newly created tax, and note the total amount.Proposed Solution:
To ensure that taxes are applied consistently regardless of input order, we will modify the
flatten_taxes_hierarchy
function to add sorting by id. If the sequences are identical, the sorting will depend only on the id, otherwise it will be based on the sequence. This setting ensures a predictable and logical process for applying taxes.opw-3691765
Forward-Port-Of: #155414
Forward-Port-Of: #154167