Monday, November 14, 2022
7 changes · master
Enhancements to existing features
This update adds missing automated tests for Odoo's background task scheduler, helping catch issues before they affect operations. It especially strengthens coverage for timing and concurrency scenarios that previously caused subtle reliability problems.
Original PR description
The cron subsystem is the system responsible of running background task at regular interval, it runs in multiple dedicated threads or workers that are independent of the regular HTTP threads/workers.…
The cron subsystem is the system responsible of running background task at regular interval, it runs in multiple dedicated threads or workers that are independent of the regular HTTP threads/workers. There was a major overhaul of the system in v15 (4b28f1162a8) to introduce cron triggers, a way to run a task at a given moment in addition to the regular configured interval. Although the cron system was not extensively tested before that v15 refactor, no new test were introduced with that refactor leaving the system mostly untested. Since then we had to fix multiple subtle concurrency bugs such as b940d1c25f8 and c06cee44fe1. Due to the lack of an existing test suite, no regression tests were added next to those fixes. With this commit we introduce the missing cron test suite. The test suite is separated in two different test cases: - A standard pre-install TransactionCase to test everything that can be tested with a single cursor. This case can be run the usual way with `--test-tags :TestIrCron`. - A non-standard post-install **database breaking** test case to run concurrency tests that often require multiple SQL transactions. This case requires the special `--test-tags database_breaking` to be executed. You MUST backup your current database before running that test or you'll loose data.
This update moves styling settings that are only used by Live Chat out of the broader Mail area and into the Live Chat module. This keeps the product code better organized and reduces unnecessary coupling between Mail and Live Chat, with no expected change for end users.
Administrators editing interface views can now select and open the related model from a proper linked field instead of editing only a text value. This makes configuration easier and reduces friction when reviewing or updating view settings.
Original PR description
When using the view "edit view" on the interface as administrator, the user can see and modify the model of the view as a string, but cannot navigate to the model easily or edit the model field by selecting the model in a list. This pull request adds the possibility to view and edit the model field as a many2one. task-id: 3007619 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This change removes an unnecessary internal processing step when filtering records by a field name. It can make filtering faster on very large datasets, with minimal visible impact in everyday use.
Original PR description
The mapped call is supposed to populate the cache, but that's already taking care of by prefetching.
It ends up adding an overhead instead.
The perf improvement is more noticeable on large recordsets.
For example, on a database populated with 100k res.partner records.
Before:
```py
partners = env["res.partner"].search([])
partners.filtered("name") # warm up
timeit.timeit(lambda: partners.filtered("name"), number=100)
# result: 71.54
```
After:
```py
partners = env["res.partner"].search([])
partners.filtered("name") # warm up
timeit.timeit(lambda: partners.filtered("name"), number=100)
# result: 46.72
```
Although the perf imp is miniscule in real world cases, these lines can be misleading IMO.
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThe Mail module has been added to automated formatting and linting checks. This helps keep the codebase consistent and easier to maintain, reducing the risk of future issues without changing user-facing behavior.
The user notification alert has been moved from the mail area into the core web and base user form where it more naturally belongs. This makes the feature available without relying on mail-specific functionality and should simplify maintenance with little visible impact for users.
Original PR description
The code does not actually depend on mail features and it is intended to be used in the base form view of user.
The Helpdesk module now includes population logic to create sample or test data more easily. This helps teams evaluate, demonstrate, and test Helpdesk scenarios with more realistic data.
Original PR description
task-3035507