Daily updates from Odoo
Friday, September 6, 2024
2 changes · saas-17.2
Resolved issues and error corrections
Fixed an issue where invoices using both fixed and percentage taxes included in the price could show different tax and untaxed totals depending on tax ordering. This makes invoice calculations more reliable and prevents unexpected amount changes when taxes are refreshed or reordered.
Original PR description
### Steps to reproduce the issue: 1. Create two Taxes, one with Fixed "Tax Computation" and one with Percentage of Price. 2. Set "Included in Price" to True and and "Affect Base of Subsequent Taxes"…
### Steps to reproduce the issue: 1. Create two Taxes, one with Fixed "Tax Computation" and one with Percentage of Price. 2. Set "Included in Price" to True and and "Affect Base of Subsequent Taxes" to False for both. 3. Create an Invoice with one line, add both Taxes to it, make sure each Tax has a different amount. 4. Change the order of the Taxes in the Taxes menu 5. Refresh the Invoice Line (e.g.: remove and put back one of the taxes) 6. The amount of the "percent" Tax has changed along with the Untaxed Amount of the Invoice ### Explanation: In `_prepare_taxes_computation`, taxes are preprocessed with a priority set on fixed taxes, then taxes with `price_include` set to True, both in descending order and lastly, taxes with `price_include` set to False in ascending order. In `_propagate_extra_taxes_base`, the currently preprocessed tax is also added to the base of other taxes depending on the specifications of those taxes. When `price_include` is set to True, taxes are never being added to the base of the ones with a higher sequence, it should only be the case if `include_base_amount` is set to True as well. ### Fix reasoning: The computation should be consistent regardless of the order of the taxes, as they are not supposed to have an influence on each other. The special modes computation are changed accordingly. The change to the `total_included` special mode for non `_original_price_include` batches fixes an inconsistency when all taxes are excluded, added a test for it. opw-4068781
Creating foreign taxes for a fiscal position could fail for some countries when a tax group had no child taxes defined. The accounting setup now handles this case correctly, preventing an error and allowing users to complete the foreign tax configuration.
Original PR description
Create a new Fiscal Position and set Country: Austria Foreign Tax ID: ATU79284409 Click "here" to create the taxes for this country. Traceback will raise "KeyError: 'children_tax_ids'" This occurs because the system tries to load the children tax of a tax group with no child defined opw-4134352