Friday, January 28, 2022
16 changes · master
Enhancements to existing features
This update improves how Odoo creates multiple records at once across many business apps. It should reduce processing overhead during bulk operations and lays groundwork for more consistent performance improvements in future updates.
Original PR description
By default, the ORM supports batch creation of records, but when one `create` overrides doesn't support the creation of records in batch, records creation on the given model are done 1 by 1, disabling lots of improvements gained thanks to the manipulation of records in batch. To enable such performance improvements (at the ORM level, but also in create overrides sometimes), this PR aims to adapt the majority of existing create overrides in Odoo codebase to support batch record creation. Some of the changes won't really have any impact because the records are always created one by one, but converting them: 1) encourages new create override to support multi record creation (devs are copy/pasting/... a lot) 2) provides the basis for a potential future API change to enforce batch creation support. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Form views now keep fields, labels, and spacing more consistent when users switch between edit and read-only modes. This reduces visual jumping on the page, making data entry and review feel steadier and easier to follow.
Original PR description
Reduce shift in form view when switching mode --- This PR reduces the shift between edit and readonly mode in the form view. Reducing the shift means that both modes should be identical: * Fields should be at the same place * Fields have the same render in both modes * Labels shouldn't show only in one mode, whether they appear in both or they does not Task 2330101 Enterprise PR: https://github.com/odoo/enterprise/pull/15191
Product-related screens were reorganized to remove duplicate or unused view customizations and make tab and button ordering more consistent across apps. This should make product forms easier to maintain and reduce the risk of inconsistent behavior between product variants and templates, with minimal visible change for users.
Original PR description
## Product views cleanup * Remove duplicate `product.product/product.template` views which should only extend the common view of product.product and product.template once instead of extending once both extensions of the shared view. * Remove views extension without any impact. * Cleanup inheritance targets: the inherited view should contain the targeted modified elements, not its children. * Cleanup View ordering : * Remove ugly `sale_stock` hack to put sales statbutton after stock ones * Use generic priority values to order the product views inheritance #### Incoherences found : - stock : orderpoint access visible only for storable products on product view while it is visible for storable and consumable products on template view. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This change adds supporting accounting fields that make it easier to address performance issues in Aged Receivable reporting. It is an internal improvement intended to help accounting reports run more efficiently without changing day-to-day user workflows.
Original PR description
it simplifies fixing performance issues with Aged Receivable task-2737991 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 update makes Odoo handle company context more consistently across web screens, server calls, and attendance kiosk flows. It helps users working with multiple companies see and act on the right company information, reducing confusion and unexpected behavior.
Original PR description
#### Session multi-company API * clear access to current company(ies) * Ensure coherence between request.env.company and self.env.company in call_kw routes * Fix existing _rpc calls with routes, forgiving the user_context in params.context ... maybe more -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Odoo now avoids automatically loading translated fields that are unlikely to be used, reducing database work on large records. Key fields that are commonly displayed, such as names, website SEO content, mail templates, and VAT labels, continue to load as needed to preserve expected behavior.
Original PR description
Issue ----- Via the field prefetch mechanism, when we need a value of one field (not in cache of course), the ORM will prefetch all fields (which has the attribute to `prefetch=True`, the default…
The mail message list now calculates its scroll position in a more central place, helping conversations keep the expected position as messages are displayed. This improves the reliability and consistency of the messaging experience without changing user workflows.
Original PR description
task-2579306
Debug-mode access error messages now include the related company name when company-based record rules block records. This helps users and support teams identify which company context to switch to more quickly, while some unused internal rule code was also cleaned up.
Original PR description
In debug mode, when a company ir.rule raise a exception for one or multiple records, a feedback message is display with limited records information. Add company name to these information to help the user to change his current company to the correct one directly. task-2628865
This update improves the website shop editor so product ribbons can be adjusted more smoothly. Changes now apply automatically while editing, removing the extra validation step and making product block customization faster for website managers.
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 update standardizes how database indexes are named and handled across several Odoo apps. It also avoids installing the PostgreSQL trigram extension unless it is actually needed, reducing unnecessary setup work while keeping search-related performance support available.
Original PR description
Followup of #83015. The possible values for parameter `index` are now: `"btree"`, `"btree_not_null"` and `"trigram"`. Task 2742526
The mail discussion area now uses a clearer internal structure for dialogs, such as attachment previews. This makes the feature easier to maintain and should support more reliable future improvements without changing the user experience directly.
Original PR description
Properly define relational fields as owner/owning/content. For instance, with viewing attachment in a dialog, the modelling looked roughly like this before the commit: ``` attachment_viewer <----> dialog ``` - where attachment viewer owns dialog This commit changes it to: ``` attachment (image/card) ------> dialog <------> attachment_viewer ``` - where attachment (image/card) owns the dialog, and dialog has attachment viewer as content These changes should make modelling of dialog feels more natural. Task-2738648
Timezone options now show their UTC offset alongside the location name, such as "(UTC+02:00) Europe/Brussels". This makes it easier for users to choose the correct timezone and avoid confusion across regions.
Original PR description
Purpose ======= Display all timezones in Format "(UTC+02:00) Europe/Brussels" instead of just showing "Europe/Brussels". Upgrade: odoo/upgrade/pull/2954 Enterprise: odoo/enterprise/pull/21824 Task-2672237
This update introduces a refreshed Discuss view for mail and live chat, making conversations easier to access and manage in one place. It improves the user experience around chat windows, sidebars, and messaging navigation, which can help teams communicate more efficiently.
Original PR description
Task-2694206
Mail and snailmail dialog components were updated behind the scenes to support a future framework upgrade. This helps keep messaging features maintainable and reduces upgrade risk without changing the user experience.
Original PR description
In preparation to using OWL 2 in discuss code. Task-2738648
Several product-related screens were simplified by removing duplicate or unnecessary view customizations across enterprise apps. This reduces inconsistencies between product and product template screens, making product setup and related actions more predictable for users.
Original PR description
Remove duplicate product/template views which should only extend the common view of product.product and product.template . Remove views extension without any impact. Incoherences found : - stock : orderpoint access visible only for storable products on product view while it is visible for storable and consumable products on template view. - Enterprise/quality_control : stat buttons are accessible on product.product even if product isn't storable/consumable. Enterprise counterpart of https://github.com/odoo/odoo/pull/35774
This update moves several enterprise screens to Odoo's newer multi-company handling, helping users see company-specific information more consistently. It also ensures Studio has the correct default currency even when Dashboard is not installed.
Original PR description
Enterprise counterpart of https://github.com/odoo/odoo/pull/45120
Issue ----- Via the field prefetch mechanism, when we need a value of one field (not in cache of course), the ORM will prefetch all fields (which has the attribute to `prefetch=True`, the default value of this attribute is `True`) for all record ids in `_prefetch_ids`. Then, for each translate fields (where translate is not a callable) the ORM need to make a `LEFT JOIN` on the `ir_translation` to fetch the translated value. For big model, it leads to a simple `SELECT` with several `LEFT JOIN` on ir_translation but each LEFT JOIN have a cost in the planner time (a small cosst in the execution time) of PostgreSQL. By example, for product_template (with stock, sale and purchase installed), there are 6 LEFT JOIN to get all translate fields (5 of this fields are rarely used). Without prefetching the translate fields, there is only one LEFT JOIN (the name, which is translate but is the `_rec_name` of the model). With the 6 translate fields to fetch, the query takes 5 ms to plan and 2 ms to execute. VS with 1 translate field, it 1 ms to plan and 1.5 ms to execute. Proposed solution ----------------- Deactivate the prefetch by default for all translate fields expect if this field is the `_rec_name` of the model (which is more likely to be used). Side change note ---------------- - All translate of fields of `website.seo.metadata` should be prefetch to avoid lot of website errors (it is because, website put in cache data in sudo before reading it without sudo) - `description` (`mail.message.subtype`), `subject` (`mail.template`), `body_html` (`mail.template`) should be prefetch to avoid lot of extra query from mail module. - `vat_label` (`res.country`) should be prefetch to avoid a extra query for each website page. - Increase some queryCount (when it is legit, due to `subtitle` of `blog_post` or `description` of `event.type.ticket`, etc) task-2738029