Friday, January 28, 2022
38 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
Resolved issues and error corrections
Odoo now blocks attempts to reuse an existing external identifier for a different type of record. This prevents updates from accidentally overwriting unrelated business or system records, improving data integrity during module updates or upgrades.
Original PR description
Before this commit, changing the model on an existing xml-id may lead to strange results. create any record in xml, ie: xml_id=my_xml_id, model=new_model => Odoo will create a new external_id, pointing to (new_model, id=1) change only the model in the xml, ie: xml_id=my_xml_id, model=ir.cron => Odoo will use the id of the existing external_id with the new model and points now to (ir.cron, id=1) AND REPLACE the ir.cron id=1 (autovacuum_job) with the data of the xml. This commit simply prevent that by raising when trying to recycle the same xmlid for another model. An explicit upgrade script to remove the existing xmlid and corresponding records should be write.
Miscellaneous changes
Step to reproduce: - Go to ‘my profile’ - Action "assigned tasks" - Create task Current Behaviour: - Traceback because default assignee is not correclty set up Behaviour after PR: - Correct default assignee - No traceback opw-2742199 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#83466
Original PR description
Step to reproduce: - Go to ‘my profile’ - Action "assigned tasks" - Create task Current Behaviour: - Traceback because default assignee is not correclty set up Behaviour after PR: - Correct default assignee - No traceback opw-2742199 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#83466
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
Fixes an issue in the Sign app where an error dialog could fail to reload the page as intended. Users who encounter this dialog should now be able to continue with the expected page refresh instead of seeing a browser error.
Original PR description
In sign, when passing window.location.reload as the callback to the openErrorDialog method, an illegal invocation error was happening. This commit adds a wrapper function to it that prevents the error and correctly reloads the page.
Steps to reproduce the bug: - Have company A and B - Create a pricelist A with company A and pricelist B with company B - Select company A as current company and B as allowed company - Create contact A without linked company Problem: You can select pricelist B while the current company is A, this causes an access error if you save and only select company A in the selector. It also causes an error when you open a new POS session. This contact is not linked to a company, so it should b
Original PR description
Steps to reproduce the bug: - Have company A and B - Create a pricelist A with company A and pricelist B with company B - Select company A as current company and B as allowed company - Create contact A without linked company Problem: You can select pricelist B while the current company is A, this causes an access error if you save and only select company A in the selector. It also causes an error when you open a new POS session. This contact is not linked to a company, so it should be accessible from all companies. Solution: Add a domain to allow the user to only select the pricelist linked to the current company or a pricelist that are not linked to a company opw-2745267 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#83487
task-2723819 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#82072
Original PR description
task-2723819 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#82072
Forward-Port-Of: odoo/odoo#83531 Forward-Port-Of: odoo/odoo#83521
Original PR description
Forward-Port-Of: odoo/odoo#83531 Forward-Port-Of: odoo/odoo#83521
Improve `name_get` performance by retrieving `product_template_attribute_value_ids` names in batch before looping on self. The following line can be pretty slow when called inside a for loop. https://github.com/odoo/odoo/blob/f4b7c3eb8138c08873ecc6e23a1bb6cf5b8ceef2/addons/product/models/product_attribute.py#L521 Constructing a ptav name map beforehand makes the call to `_get_combination_name` much faster. #### speed-up Customer database with 30K products and 3 product_template_a
Original PR description
Improve `name_get` performance by retrieving `product_template_attribute_value_ids` names in batch before looping on self. The following line can be pretty slow when called inside a for loop. https://github.com/odoo/odoo/blob/f4b7c3eb8138c08873ecc6e23a1bb6cf5b8ceef2/addons/product/models/product_attribute.py#L521 Constructing a ptav name map beforehand makes the call to `_get_combination_name` much faster. #### speed-up Customer database with 30K products and 3 product_template_attribute_value on average. `product.product.name_get` average time | Number of Products | Before PR | After PR | |:--------------------------:|:---------------:|:-----------:| | 1 | 0.15s | 0.01s | | 25 | 0.07s | 0.02s | | 100 | 0.14s | 0.03s | | 500 | 0.59s | 0.11s | | 2000 | 1.84s | 0.34s | | 10000 | 5.71s | 1.21s | opw-2624261 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#75893
When the assets are regenerated, the previous attachments are deleted. This may happen during the execution of t-call-assets directives in a qweb view. However, some properties that have been accessed with a sudo() were accessible in the cache. Clearing the cache during the view rendering could lead to access errors, which wouldn't be present without this directive. This commit works around this problem by removing these attachments with a SQL query, without relying on the classic unlink,
Original PR description
When the assets are regenerated, the previous attachments are deleted. This may happen during the execution of t-call-assets directives in a qweb view. However, some properties that have been accessed with a sudo() were accessible in the cache. Clearing the cache during the view rendering could lead to access errors, which wouldn't be present without this directive. This commit works around this problem by removing these attachments with a SQL query, without relying on the classic unlink, so that the cache is preserved in this case. By the way, sanitize the filename when marking it for deletion. Forward-Port-Of: odoo/odoo#83527 Forward-Port-Of: odoo/odoo#83341
Current behavior : When modifyin the decimal point and thousands separator in the language you're using the changes where not reflected in the pricelists Steps to reproduce: - Use the language en_US - Set the decimal separator to , instead of . and change the thousand separator from . to , - Use the "activate and translate" smart button, "add" the language and "close and switch to the US language" - Open a pricelist and the pricelist item in the list is with a decimal separator of . inst
Original PR description
Current behavior : When modifyin the decimal point and thousands separator in the language you're using the changes where not reflected in the pricelists Steps to reproduce: - Use the language en_US - Set the decimal separator to , instead of . and change the thousand separator from . to , - Use the "activate and translate" smart button, "add" the language and "close and switch to the US language" - Open a pricelist and the pricelist item in the list is with a decimal separator of . instead of , - But if you click on the item, the separator is correct. PS : I had to duplicate a runbot to reproduce the issue opw-2715993 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#83492 Forward-Port-Of: odoo/odoo#83264
Revert 9f7e6d2bb6ae0a6b0257edf26a5aa069cd00d78e Task-2678388 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#83361 Forward-Port-Of: odoo/odoo#80612
Original PR description
Revert 9f7e6d2bb6ae0a6b0257edf26a5aa069cd00d78e Task-2678388 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#83361 Forward-Port-Of: odoo/odoo#80612
Before this commit, the call participant cards in the sidebar of the call viewer didn't respect the 16:9 aspect ratio on some browsers like chrome. This commit fixes the issue. task-2738622 Forward-Port-Of: odoo/odoo#83346 Forward-Port-Of: odoo/odoo#83310
Original PR description
Before this commit, the call participant cards in the sidebar of the call viewer didn't respect the 16:9 aspect ratio on some browsers like chrome. This commit fixes the issue. task-2738622 Forward-Port-Of: odoo/odoo#83346 Forward-Port-Of: odoo/odoo#83310
Due to some changes in the ORM, the previous implementation doesn't allow the override of a method to be called. Forward-Port-Of: odoo/odoo#83468
Original PR description
Due to some changes in the ORM, the previous implementation doesn't allow the override of a method to be called. Forward-Port-Of: odoo/odoo#83468
Set fec_data to attachment True to avoid storing data ion DB Task: 2453453 Forward-Port-Of: odoo/odoo#80596
Original PR description
Set fec_data to attachment True to avoid storing data ion DB Task: 2453453 Forward-Port-Of: odoo/odoo#80596
Followup of #82838 and #82844 By default, every subclass of BaseModel is registered in a mapping for the automatic discovery of model classes by registries. Prevent registration of the mockup class used for rendering the database manager templates. Forward-Port-Of: odoo/odoo#83597
Original PR description
Followup of #82838 and #82844 By default, every subclass of BaseModel is registered in a mapping for the automatic discovery of model classes by registries. Prevent registration of the mockup class used for rendering the database manager templates. Forward-Port-Of: odoo/odoo#83597
Forward-Port-Of: odoo/enterprise#23809
Original PR description
Forward-Port-Of: odoo/enterprise#23809
Some banks seem to return OFX dates with "00000000" as well as empty tags. We should manage both cases as it shouldn't prevent the import of the file for a non-blocking issue. Forward-Port-Of: odoo/enterprise#23778
Original PR description
Some banks seem to return OFX dates with "00000000" as well as empty tags. We should manage both cases as it shouldn't prevent the import of the file for a non-blocking issue. Forward-Port-Of: odoo/enterprise#23778
After produced less products than planned in workorder tablet view and clicked record_production button. Made the following changes: 1. hide the "continue" button since the workorder is done 2. instead of showing "qty_producing/qty_remaining", show "qty_producing/qty_production" since qty_remaining has been updated. Task-2678388 Forward-Port-Of: odoo/enterprise#23742 Forward-Port-Of: odoo/enterprise#22614
Original PR description
After produced less products than planned in workorder tablet view and clicked record_production button. Made the following changes: 1. hide the "continue" button since the workorder is done 2. instead of showing "qty_producing/qty_remaining", show "qty_producing/qty_production" since qty_remaining has been updated. Task-2678388 Forward-Port-Of: odoo/enterprise#23742 Forward-Port-Of: odoo/enterprise#22614
This is especially useful when a mass action needs to be performed on specific levels only. [task-2726528](https://www.odoo.com/web#id=2726528&model=project.task) Forward-Port-Of: odoo/enterprise#23684
Original PR description
This is especially useful when a mass action needs to be performed on specific levels only. [task-2726528](https://www.odoo.com/web#id=2726528&model=project.task) Forward-Port-Of: odoo/enterprise#23684
No need to use `.html()` here. By chance the alias is formated to avoid expression (see `_sanitize_alias_name`) but don't want to take any risk. Forward-Port-Of: odoo/enterprise#23161
Original PR description
No need to use `.html()` here. By chance the alias is formated to avoid expression (see `_sanitize_alias_name`) but don't want to take any risk. Forward-Port-Of: odoo/enterprise#23161
Steps to follow - Go to accounting > Reporting > Balance sheet - Go back to the home menu - Resize your browser -> $(...).offset() is undefined Cause of the issue The event listener was not correctly unregistered Solution Use `on_detach_callback` instead of `destroy` Forward-Port-Of: odoo/enterprise#23352
Original PR description
Steps to follow - Go to accounting > Reporting > Balance sheet - Go back to the home menu - Resize your browser -> $(...).offset() is undefined Cause of the issue The event listener was not correctly unregistered Solution Use `on_detach_callback` instead of `destroy` Forward-Port-Of: odoo/enterprise#23352
The general ledger is showing tax reports line when only selecting a single journal of type sale or purchase. The issue is that the method called only exists on the tax report and not the general ledger, so it gives a traceback. This is fixed by adding a method calling the correct one in the tax report from the general ledger. Forward-Port-Of: odoo/enterprise#23806
Original PR description
The general ledger is showing tax reports line when only selecting a single journal of type sale or purchase. The issue is that the method called only exists on the tax report and not the general ledger, so it gives a traceback. This is fixed by adding a method calling the correct one in the tax report from the general ledger. Forward-Port-Of: odoo/enterprise#23806
Steps : - config : { "--init=hr,hr_contract", "--without-demo=all", } - Employees > Reporting > Contracts (Dashboard view) - Pivot section > Measures : Date Last Contract Ended Issue : - Whatever the measure value is, an Odoo Client Error occurs. Cause : - the dashboard aggregate "Date Last Contract Ended" is wrongly added to the list additionalMeasures passed to its subviews. Fix : - We restore the original dashboard behavior: we only add aggregates that are many2o
Original PR description
Steps :
- config : {
"--init=hr,hr_contract",
"--without-demo=all",
}
- Employees > Reporting > Contracts (Dashboard view)
- Pivot section > Measures : Date Last Contract Ended
Issue :
- Whatever the measure value is, an Odoo Client Error occurs.
Cause :
- the dashboard aggregate "Date Last Contract Ended" is wrongly added
to the list additionalMeasures passed to its subviews.
Fix :
- We restore the original dashboard behavior: we only add aggregates
that are many2one in additionalMeasures.
opw-2728024
Forward-Port-Of: odoo/enterprise#23699