Friday, December 15, 2023
3 changes · master
Resolved issues and error corrections
This fixes how Odoo calculates certain percentage-based taxes used in Brazilian accounting, especially when taxes are included in the displayed price. Businesses using these tax rules should see more accurate invoice and order totals, reducing accounting errors and manual corrections.
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fix stops Odoo from saving the open or folded state of live chat windows that are temporary or about to be closed. It prevents errors when visitors fold a new chat before sending a message and avoids unnecessary server updates during chat closure.
Original PR description
Since [1], the fold state of the live chat is stored on the server. However, this save is also done for temporary live chats (that are not saved on the server). As a consequence, an error occurs when a user folds a chat window before posting any message. Steps to reproduce the issue: - Open a live chat - Send a message - Close the live chat - Open another live chat - Fold the chat window - An error occurs Another undesirable save is triggered when the chat window opens to show the feedback panel: the live chat is about to be discarded so saving the state is not required. Steps to reproduce the issue: - Open a live chat - Send a message - Fold the chat window - Click on close - The chat window opens and the "open" state is saved on the server. This PR fixes both issues. [1]: https://github.com/odoo/odoo/pull/145905
This fix ensures certain Brazilian taxes included in the price are calculated from the correct total amount. It prevents incorrect tax values in accounting, reconciliation, and localized point-of-sale or e-invoicing flows where division-style taxes apply.
Original PR description
The current tax engine doesn't work with division taxes because the tax amounts must be computed on the price included amount but can't be on the price excluded one. Unfortunately, the current engine is finding first the price excluded amount before computing "really" the tax amounts. It means, 20% division price included on 100 should be computed as: 100 * 0.2 = 20 However, when trying to compute the tax amount on 100 - 20 = 80, we are not able to retrieve the original tax amount of 20. opw: 3443703