Tuesday, September 2, 2025
5 changes · saas-18.3
Enhancements to existing features
Developers can now run selected tests directly from the Odoo shell after changing test code, without restarting the full server. This should speed up debugging and improve development workflow, while business logic changes still require a shell restart.
Original PR description
This commit introduces a new function `run_tests` to the Odoo shell. This function allows users to run specific tests directly from the shell, even after the test code is modified. This significantly…
This commit introduces a new function `run_tests` to the Odoo shell. This function allows users to run specific tests directly from the shell, even after the test code is modified. This significantly speeds up the debugging process by avoiding the need for a full server restart. In the odoo shell ``` >>> from odoo.tests.shell import * >>> run_tests(env, 'test_tags', modules=[module_name], reload_tests=True) ``` Note: `run_tests` automatically reloads test modules but does not reload Odoo model code. A shell restart is still required after any change to business logic. used by https://github.com/HydrionBurst/odoo-test-vscode for hot test vscode extension: [odoo-test-0.0.1.vsix.zip](https://github.com/user-attachments/files/22089685/odoo-test-0.0.1.vsix.zip) tutorial: https://github.com/HydrionBurst/odoo-test-vscode?tab=readme-ov-file#-hot-test 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 Forward-Port-Of: odoo/odoo#225024 Forward-Port-Of: odoo/odoo#224048
Module upgrade processing now uses less memory when handling large website view data. This helps prevent database access failures during upgrades, improving reliability for affected customers.
Original PR description
### Issue A user cannot access their database (Bad Gateway) after trying to upgrade a module. ### Analysis The root cause is the out of memory error, stemming from the SQL query fetching all `arch_db` and then fetching them with `fetchall`. ### Solution This commit optimizes the loading of module terms in the `ir_module_module` model by iterating over the rows per chunks. This change reduces the memory footprint, which is crucial when dealing with heavy `arch_db` in the `ir_ui_view` table. We also filter out `if not generic_arch_db` directly in the SQL query instead of on the Python side. After applying this patch, there is no more `MemoryError` and the user can access their database. ### References opw-5014922 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#224709 Forward-Port-Of: odoo/odoo#223439
Creating records with HTML content now avoids repeating an expensive cleanup step, which makes large email and marketing batches run much faster. This reduces processing time and memory use, especially for mass mailing campaigns with many recipients.
Original PR description
Description ----------- When creating records with `vals` for HTML fields, there are two 'sanitization' operations happening: 1) Once in `convert_to_column`, when converting the `vals` for *database*…
Description ----------- When creating records with `vals` for HTML fields, there are two 'sanitization' operations happening: 1) Once in `convert_to_column`, when converting the `vals` for *database* insertion 2) Once post-insert in `convert_to_cache`, when converting the `vals` for insertion in the *cache* for the newly created records. This redundancy has a negative performance impact when creating many records where new HTML fields are set, e.g., mass-mailing, as potentially large HTML documents are parsed and validated, often with external libraries. To address this issue, this commit removes the insertion into *cache* of the HTML values for the newly created records. This removes the overhead of the second sanitization, speeding up the creation, and also helps with overall memory pressure, as we're not inserting large HTML fields into cache. The latter is particularly noticeable for long-running batch creation processes that do *not* commit intermediate results. The downside of this patch is the potential *cache-miss* (and therefore the subsequent *query*) if the HTML field of the newly created records is read. This is unlikely in business code because intrinsically, an HTML field is often just a data 'blob' that has no logical usage. In the rare case where it needs to be read after creation, since the value in the database is already sanitized, re-sanitization is not necessary for insertion in the cache. Given these considerations, the trade-off seems reasonable to make. Benchmark --------- In a scenario for a marketing campaign with 1000 recipients, using a *mid-sized* email template and emulating a typical campaign, the results were: | Method | Before | After | Speed up | |-------------------------------|----------|-----------|----------| | `_process_mass_mailing_queue` | 2.84 min | 1.55 min | 1.8x | | `create` | 2.11 min | 50.23 sec | 2.5x | This represents roughly a *2x* performance improvement in processing an email campaign. * more detailed benchmarks are available in the task's description Reference --------- task-4962646 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#224534 Forward-Port-Of: odoo/odoo#223875
The Italian XML export now shows a 'Close' button instead of 'Submit' for monthly LIPE tax periods that are not quarter-end months. This reduces confusion for users by matching the action label to the expected month-end workflow.
Original PR description
- Dynamically set the `submittedLabel` to 'Close' instead of 'Submit' when the tax period do not correspond to the last month of a quarter (March, June, September, December). task-4825570
This change updates internal performance test expectations for the Knowledge app after a technical change in how HTML content is cached when records are created. It helps keep automated performance checks accurate without changing user-facing features.
Original PR description
Adapting query count, due to not putting html fields in cache upon creation. task-4962646 Forward-Port-Of: odoo/enterprise#93344 Forward-Port-Of: odoo/enterprise#93171