Daily updates from Odoo
Tuesday, December 10, 2024
3 changes · 18.0
Enhancements to existing features
Project portal link sections can now be configured to open specific links in a new browser tab instead of always replacing the current page. This gives businesses more flexibility when linking to related resources such as documents while keeping users' project context available.
Original PR description
- 18.0
Before this commit, the portal link opens in the current tab. After this commit, we can open the link in a new tab also, by only passing one key 'target' in task_link_section list.
e.g.values['task_link_section'].append({
'access_url': url,
'title': _('Documents'),
'target': '_blank'
})
task-4194318
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prSales commission reporting now handles quarterly payment grouping more accurately and makes forecasts easier to review for future periods. Sales managers can better track expected commission performance by salesperson, even when no achievements have been recorded yet.
Original PR description
taskid: 4376927
Document access checks have been optimized to avoid overly complex database queries. This should make permission-related actions in Documents significantly faster, improving responsiveness for users working with document access rights.
Original PR description
## Description Most read `ir.rule` on documents are based around the searchable field `user_permission`. Both `documents.document` and `documents.access` rely on it, and its' implementation creates a…
## Description Most read `ir.rule` on documents are based around the searchable field `user_permission`. Both `documents.document` and `documents.access` rely on it, and its' implementation creates a recursive application of the ir.rule, as `documents.document` calls `_search_user_permission`, which reads on `documents.access`, whos `ir.rule` rely on `document_id.user_permission`, re-applying the same domain from `_search_user_permission`. This recursive-like behaviour creates excessively large queries with a lot of subquery, exploding the costs of it above the `jit_above_cost` threshold (500k by default), leading to slow execution, due to the JIT optimizer, which normally should be reserved for long analytical queries. ## Patch Adding `auto_join=True` on `documents.access.document_id` will transform some of the subqueries in joins, and is done in `sudo` context, avoiding re-application of the `ir.rule` while resolving itself. The simplification of the query leads to lower query cost that is bellow the `jit_above_cost` threshold, removing the slow optimisation step, leading to faster execution, as it was the main bottleneck. ## Benchmark On a db with a moderately sized `documents_document` table: | Timings | Before | After | Speed up | |-------------------------------|--------|-------|----------| | `action_update_access_rights` | 7s | 550ms | 12.7x | ## Reference task-4381572