Wednesday, January 19, 2022
12 changes · master
Enhancements to existing features
This update reviews and improves how database indexes are used across many Odoo apps. It should make searches, filtering, and record lookups faster in areas such as accounting, CRM, calendar, events, email, gamification, HR, recruitment, and timesheets, especially on large databases.
Original PR description
[IMP] Better handling of indexes
Three supported types:
- btree (default)
- btree not null (when >90% of the data are null)
- gin trigram search (for char fields)
Review of indexes on all objects.
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prRental charges now support partial durations, so a 1 hour 30 minute rental can be billed as 1.5 hours instead of rounding up to 2 hours. This makes pricing fairer for customers and more flexible for businesses offering short-term rentals.
Original PR description
Currently renting a product for 1h30 will charge you for 2h. This commit allows charging 1.5 the hourly rate, therefore allowing partial rentals. task-2702170
The app home menu search has been unified with the command palette, so users get a more consistent way to find and open apps or menus. This reduces duplicate search behavior and improves navigation consistency across the interface, including updated keyboard shortcut handling.
Resolved issues and error corrections
This update fixes a small naming issue in the web command palette footer that could prevent the interface component from working correctly. It helps keep the command palette stable and consistent for users without changing business workflows.
Original PR description
This commit solves a naming error introduced by commit 1e1b45ea62a180f01204be232677d28675a7e6ff, the name of a component always starts with a capital letter. 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
Code cleanup and technical improvements
The Point of Sale asset structure was simplified to make it easier to manage what files are loaded. This is an internal cleanup that lays the groundwork for potentially smaller and faster POS loading in the future, without changing current user workflows.
Original PR description
This commits simplifies the asset management in pos. It also opens the possibility to reduce the size of assets loaded in POS, see the contents of `point_of_sale.pos_assets_backend`. Looking at that bundle, it's now obvious that we can cherry pick the list of assets we need from `web.assets_common` and `web.assets_backend`. Note that manual picking the `web` assets is not done in this commit. TASK-ID: 2669134 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
The tool to change background color in mass mailing will currently target `<div/>` elements and set the property as !important. On outlook software (or windows mail app) this seems to fail: - background-color should be set on table / tr / td / th - !important should not be used In this fix we target table instead of div, and we remove the !important declaration. TODO: check if we should remove !important or only in mass mailing case. opw-2641343 Forward-Port-Of: odoo/odoo#8279
Original PR description
The tool to change background color in mass mailing will currently target `<div/>` elements and set the property as !important. On outlook software (or windows mail app) this seems to fail: - background-color should be set on table / tr / td / th - !important should not be used In this fix we target table instead of div, and we remove the !important declaration. TODO: check if we should remove !important or only in mass mailing case. opw-2641343 Forward-Port-Of: odoo/odoo#82797 Forward-Port-Of: odoo/odoo#81494
steps to reproduce: - install blog - create more than 12 articles with at least on word (the one we will search for) - Go to the "blog" menu of the website - Go in the search field - Search for the word in the created articles -> Odoo removes the search criteria on the blog (Website) + number of results is inconsistent OPW-2720355 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82561
Original PR description
steps to reproduce: - install blog - create more than 12 articles with at least on word (the one we will search for) - Go to the "blog" menu of the website - Go in the search field - Search for the word in the created articles -> Odoo removes the search criteria on the blog (Website) + number of results is inconsistent OPW-2720355 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82561
The aim of this commit is to allow user to post a reversed entry even when the date for the reversed has been set in the future. before this commit: if the move is generated using the reverse entry button and a date in the future, the reverse entry is created with auto_post True and is readonly in the view resulting in the user being unable to post the move himself. after this commit: auto_post can be manually set to false and the user can post the move himself. task: #2522640
Original PR description
The aim of this commit is to allow user to post a reversed entry even when the date for the reversed has been set in the future. before this commit: if the move is generated using the reverse entry button and a date in the future, the reverse entry is created with auto_post True and is readonly in the view resulting in the user being unable to post the move himself. after this commit: auto_post can be manually set to false and the user can post the move himself. task: #2522640 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#81254
In some cases, when making an inventory adjustment, the `in_date` of the new quant will be incorrect To reproduce the issue: (Let D01 be the current date) 1. Create a storable product P 2. Set its quantity to 1 3. Process a delivery order with 1 x P 4. Set the date in the future - Let D02 be this date 5. Make an inventory adjustment with 1 x P Error: The `in_date` of the quant (for P in the stock location) is D01 instead of D02 (can be observed either directly in PSQL, on the
Original PR description
In some cases, when making an inventory adjustment, the `in_date` of the new quant will be incorrect To reproduce the issue: (Let D01 be the current date) 1. Create a storable product P 2. Set its…
In some cases, when making an inventory adjustment, the `in_date` of the
new quant will be incorrect
To reproduce the issue:
(Let D01 be the current date)
1. Create a storable product P
2. Set its quantity to 1
3. Process a delivery order with 1 x P
4. Set the date in the future
- Let D02 be this date
5. Make an inventory adjustment with 1 x P
Error: The `in_date` of the quant (for P in the stock location) is D01
instead of D02 (can be observed either directly in PSQL, on the form
view of the quant (via Locations > Current Stock), or by adding the
field on the tree view)
When validating the stock adjustment, at some point, the module calls
`_action_done` on a SML (1 x P from Inventory Adjustment to the Stock
Location). To do so, it decreases the quantity of the origin location
and increases the quantity of the destination location thanks to
`_update_available_quantity`:
https://github.com/odoo/odoo/blob/b4a9e5b8307ab1b730effe2de23f15260326ef6c/addons/stock/models/stock_move_line.py#L485-L493
But here is the issue: when decreasing the quantity in the virtual
location (Inventory Adjustment), it finds an old quant (the one from
step 2 in above use case). It then stores its `in_date` (D01) and since
this date is before the current one (D02), D01 is kept, used to update
the quant quantity and returned in `action_done`. As a result, when
increasing the quantity in the stock location,
`_update_available_quantity` is called with the parameter `in_date`
defined and equal to D01. Again, D01 will be the earliest date, so the
date will be used to create/update the quant in stock location.
OPW-2702198
Forward-Port-Of: odoo/odoo#82975
Forward-Port-Of: odoo/odoo#82566When returning a kit, the margin of the related SO decreases To reproduce the issue: (Need sale_management) 1. In Settings, enable "Margins" 2. Create a Product Category PC: - Costing Method: FIFO 3. Create two products P_kit, P_compo: - Both: - Type: Storable - Category: PC - P_compo: - Cost: 10 4. Update P_compo quantity: 1 5. Create a BoM: - Product: P_kit - Type: Kit - Components: 1 x P_compo 6. Update P_kit's cost 7. Create
Original PR description
When returning a kit, the margin of the related SO decreases
To reproduce the issue:
(Need sale_management)
1. In Settings, enable "Margins"
2. Create a Product Category PC:
- Costing Method: FIFO
3. Create two products P_kit, P_compo:
- Both:
- Type: Storable
- Category: PC
- P_compo:
- Cost: 10
4. Update P_compo quantity: 1
5. Create a BoM:
- Product: P_kit
- Type: Kit
- Components: 1 x P_compo
6. Update P_kit's cost
7. Create and confirm a SO with 1 x P_kit, unit price = $100
- Note that the margin is correct: $90
8. Process the related picking
9. Create a return R
10. Go back to the SO
Error: the margin is now $80
When computing the cost of the kit, the move linked to R are considered.
Therefore, the cost becomes $20 and thus the margin becomes $80
OPW-2679473
Forward-Port-Of: odoo/odoo#82981
Forward-Port-Of: odoo/odoo#81606When you are choosing to apply a down payment on a sale order in pos, it'll add a line to the pos order with the down payment product and the value you choosed. In this case we are considering that the down payment product is set and a traceback is triggered when you try to apply down payment. So we are now handling this error when no down payment is configured. Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged:
Original PR description
When you are choosing to apply a down payment on a sale order in pos, it'll add a line to the pos order with the down payment product and the value you choosed. In this case we are considering that the down payment product is set and a traceback is triggered when you try to apply down payment. So we are now handling this error when no down payment is configured. 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#83001
Before PR: If a tax included in price is used, an error is raised. After de PR a user error warns to change the tax Forward-Port-Of: odoo/enterprise#23091
Original PR description
Before PR: If a tax included in price is used, an error is raised. After de PR a user error warns to change the tax Forward-Port-Of: odoo/enterprise#23091