Friday, December 15, 2023
8 changes · master
Enhancements to existing features
French customer and company records now show localized registry labels, using SIRET/SIREN terminology where relevant. This makes French legal identifiers clearer on records, invoices, and company document layouts, reducing ambiguity for users handling French accounting documents.
Original PR description
Adds a way to have dynamic fields label based on the record country_id field. This will be used in l10n_fr to have the company_registry field named SIREN if the partner or company has its address in France. task id #2827661 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update improves how Odoo chooses new accounting codes so they stay consistent with local chart of accounts rules and avoid odd or overly long codes. It also lets EU OSS tax reporting use dedicated existing accounts, such as Germany's OSS accounts, instead of creating unnecessary duplicates.
Original PR description
### Context While doing the balancing of the Balance Sheets, I found that: 1. some OSS accounts were being created with non-sensical account codes (e.g. in Lithuania, the OSS account is created with…
### Context
While doing the balancing of the Balance Sheets, I found that:
1. some OSS accounts were being created with non-sensical account codes (e.g. in Lithuania, the OSS account is created with code 4402 whereas the basic VAT Payable account has code 4492),
2. some CoAs already have a dedicated account for OSS (e.g. Germany should use account 1767 for OSS), but we create a new one.
### Problem 1: non-sensical account codes
At heart, this is due to the implementation of `_search_new_account_code`. What it should do, is start with the given `prefix`, expand it to `digits`, and increment it until an available code is found.
However, this is not what `_search_new_account_code` does at the moment: if `len(prefix) == digits`, it truncates the last digit of `prefix`, then appends 1, 2, 3, ... until an available code is found.
This behaviour is unwanted for two reasons:
- Firstly, if `prefix` ends with a different digit than `0` or `1`, we want to only try codes higher than `prefix`.
- Secondly, the resulting code may exceed the expected number of digits passed to it. This was ruled by TSB as something that should be avoided, due to constraints on the length of codes in some countries (e.g. limited to 8 in Germany).
We therefore change the behaviour of `_search_new_account_code` to the following:
1. _search_new_account_code now takes an argument `start_code`, which is a code to start incrementing from, instead of `prefix` and `digits`.
2. We check whether `start_code` is available; if not, we increment it until an available code is found. The incrementation works by regexing an integer at the end of the `start_code` string, and incrementing it without increasing the length of the code.
3. If, due to non-numeric characters in the code, the incrementation fails, or if no codes are available, we fallback to `'{start_code}.copy'`, `'{start_code}.copy2'`, etc.
Because `_search_new_account_code` is used to create new account codes when loading CoA templates, this change in behaviour (in particular, ensuring that the generated code has the specified number of digits) requires us as well to fix too-low values of the `code_digits` property on CoA templates.
I also note that while the implementation of `AcccountAccount.copy()` does not currently use `_search_new_account_code`, we could consider using it at some point.
### Problem 2: CoAs that already provide an OSS account
We need a way to specify an existing account from the CoA if there is one dedicated for OSS. For this, I've just added the CoA accounts directly in the `l10n_eu_oss` module, as I didn't think providing a prefix in each localization's template was needed. However, if that's considered better, I'm open to the change.
Enterprise PR: https://github.com/odoo/enterprise/pull/48066
taskids: 3521121, 3523224Discuss sidebar categories can now be managed through mail records instead of a fixed registry. This makes it easier to introduce or adjust categories dynamically, including for live chat, while aligning the implementation with the rest of Discuss.
Original PR description
Before this PR, a registry was used to list the categories shown in the discuss sidebar. This can be done easily with mail records instead. Doing so will allow to add new categories dynamically. Moreover, this is more consistent with the discuss code base. part of task-3640730 enterprise: https://github.com/odoo/enterprise/pull/52873
WhatsApp conversation categories in Discuss can now be managed through mail records instead of a fixed registry. This makes it easier to add new sidebar categories over time and keeps the feature aligned with the rest of Discuss.
Original PR description
Before this PR, a registry was used to list the categories shown in the discuss sidebar. This can be done easily with mail records instead. Doing so will allow to add new categories dynamically. Moreover, this is more consistent with the discuss code base. part of task-3640730 enterprise: https://github.com/odoo/odoo/pull/146451
Austrian financial reports now use account codes instead of optional account tags, reducing the risk of missing or inaccurate figures when tags are absent. The balance sheet also calculates profit and loss automatically, improving consistency without relying on specific account setup.
Original PR description
Replace the tags_id used in domains in the financial reports by the account ids. Tags ids are not required and could be missing on accounts, using account ids helps to have financial reports staying as correct as possible. Also change the balance sheet so that it automatically calculate the p&l balance instead of relying on specific accounts for it. Task id #2612900
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