Monday, April 14, 2025
19 changes · saas-18.1
Resolved issues and error corrections
Closing the AI text generator dialog in Website editing no longer triggers an error. This prevents an unexpected traceback for users editing page snippets and keeps the editing flow uninterrupted.
Original PR description
Steps to reproduce the bug: - Enter Website Edit mode. - Drag and drop a snippet onto the page. - Click on the text in the snippet and then click on the AI text generator button in the editor toolbar. - Close the dialog. - A traceback occurs. The `onClose` handler in the `openChatGPTDialog` function was previously passing the `restore` function directly. This caused a TypeError when `closeParams` was introduced as an argument in the `onClose` function of the `dialogService` since this commit [1]. The bug comes from the fact that the `preserveCursor` function's `restore` expects a Map object, but `closeParams` is an object. To fix this, the `onClose` handler now calls `restore` inside an anonymous function (`() => restore()`) to avoid passing unexpected values and prevent the TypeError. [1]: https://github.com/odoo/odoo/commit/31c00161fd3a77c9fbd260754cb8c142fcb0d652 task-4708314
Miscellaneous changes
Issue --> When the Replenishment view is opened, the method `_unlink_processed_orderpoints` is called to remove previously automatically created orderpoints that have since been refilled. In this method, the search domain contains `qty_to_order` which causes computations to fulfil the search query. The search_query also contains `("trigger", "=", "manual")`. Even if the recordset for this leaf is 0, the `qty_to_order` computations still occur, only to return 0 records in the search. Soluti
Original PR description
Issue --> When the Replenishment view is opened, the method `_unlink_processed_orderpoints` is called to remove previously automatically created orderpoints that have since been refilled. In this…
Issue -->
When the Replenishment view is opened, the method `_unlink_processed_orderpoints` is called to remove previously automatically created orderpoints that have since been refilled. In this method, the search domain contains `qty_to_order` which causes computations to fulfil the search query. The search_query also contains `("trigger", "=", "manual")`. Even if the recordset for this leaf is 0, the `qty_to_order` computations still occur, only to return 0 records in the search.
Solution -->
Move the `qty_to_order <= 0` check after the search produces a recordset for `("trigger", "=", "manual")`. This avoids unnecessary computations.
Benchmarks -->
For this benchmark, we'll assume the worst case, where every orderpoint on the database has trigger set to `auto`. The number of seconds represents the time taken to open the Replenishment view.
| # of auto trigger orderpoints | Before | After |
|--------|--------|--------|
| 12.2k | 155.58 s | 4.49 s |
| 6k | 59.87 s | 3.78 s |
opw-4606704
Forward-Port-Of: odoo/odoo#203182Before this commit, retrieving the QR code from the PoS interface would result in an error due to a missing `cliTrxNumber` in the request. This issue occurs because the `structured_communication` is empty when sending from PoS. opw-4599402 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#200131
Original PR description
Before this commit, retrieving the QR code from the PoS interface would result in an error due to a missing `cliTrxNumber` in the request. This issue occurs because the `structured_communication` is empty when sending from PoS. opw-4599402 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#200131
Improve references computation, notably when message history consists mainly in note-like messages (tracking with subtypes, ...). After odoo/odoo#197127 threads are split in email readers are references are missing. Task-4677717 Forward-Port-Of: odoo/odoo#204834 Forward-Port-Of: odoo/odoo#203739
Original PR description
Improve references computation, notably when message history consists mainly in note-like messages (tracking with subtypes, ...). After odoo/odoo#197127 threads are split in email readers are references are missing. Task-4677717 Forward-Port-Of: odoo/odoo#204834 Forward-Port-Of: odoo/odoo#203739
Fix a bug introduced by: https://github.com/odoo/odoo/pull/200117 ... making a bad handling of the discount during the computation of 'price_unit' / 'price_subtotal'. opw-4679139 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#205680
Original PR description
Fix a bug introduced by: https://github.com/odoo/odoo/pull/200117 ... making a bad handling of the discount during the computation of 'price_unit' / 'price_subtotal'. opw-4679139 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#205680
In this commit, we're refactoring macro.js by completely changing its operation. To detect triggers in the DOM, we no longer rely on DOM mutations, but instead check for each frame to see if the trigger is in the DOM. Once the trigger is found, we perform the action and move on to the next step. This significantly simplifies understanding of how macro.js works, tours, and, more importantly, the bugs that can occur in tours. This also avoids many indeterministic errors that could occur in
Original PR description
In this commit, we're refactoring macro.js by completely changing its operation. To detect triggers in the DOM, we no longer rely on DOM mutations, but instead check for each frame to see if the trigger is in the DOM. Once the trigger is found, we perform the action and move on to the next step. This significantly simplifies understanding of how macro.js works, tours, and, more importantly, the bugs that can occur in tours. This also avoids many indeterministic errors that could occur in the tours due to the completely arbitrary "checkDelay" parameter (the time period after which there are no more mutations before the element is checked to see if it is in the DOM). This checkDelay parameter is therefore no longer used. It will be completely removed from the codebase in a future PR. Forward-Port-Of: odoo/odoo#194508
Steps to reproduce: - Enter website edit mode. - Drag and drop the Tabs snippet onto the page. - Click on the third tab to activate it. - Click the minus (-) button to remove the tab. - No other tab is activated after removal, leaving the tab content area empty. This commit ensures that if a tab is removed, the next available tab is activated automatically. This commit fixes another minor issue: When the direction option is set to "vertical", the expected vertical padding was
Original PR description
Steps to reproduce: - Enter website edit mode. - Drag and drop the Tabs snippet onto the page. - Click on the third tab to activate it. - Click the minus (-) button to remove the tab. - No other tab is activated after removal, leaving the tab content area empty. This commit ensures that if a tab is removed, the next available tab is activated automatically. This commit fixes another minor issue: When the direction option is set to "vertical", the expected vertical padding was not applied due to an incorrect selector. Forward-Port-Of: odoo/odoo#205702 Forward-Port-Of: odoo/odoo#204253
Description of the issue/feature this PR addresses: If we try to reload the template, an error is raised. So, we will raise the error if the change has some meaning Current behavior before PR: an Error is raised when updating a German plan Desired behavior after PR is merged: no Error is raised @alialfie --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#205480
Original PR description
Description of the issue/feature this PR addresses: If we try to reload the template, an error is raised. So, we will raise the error if the change has some meaning Current behavior before PR: an Error is raised when updating a German plan Desired behavior after PR is merged: no Error is raised @alialfie --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#205480
PoS user can't open the product information on the product screen of a PoS session. This is because it will lead to the compute of the quantities. Doing so, we will first go in the override of mrp, in case the product is a kit. This will query the BoM model. However, a PoS user hasn't any access to the module. The fix follows the same logic as - account: https://github.com/odoo/odoo/commit/fe6b351e04b7aa7d311cc07362d82f9843dde862 - purchase: https://github.com/odoo/odoo/commit/e9d809
Original PR description
PoS user can't open the product information on the product screen of a PoS session. This is because it will lead to the compute of the quantities. Doing so, we will first go in the override of mrp, in case the product is a kit. This will query the BoM model. However, a PoS user hasn't any access to the module. The fix follows the same logic as - account: https://github.com/odoo/odoo/commit/fe6b351e04b7aa7d311cc07362d82f9843dde862 - purchase: https://github.com/odoo/odoo/commit/e9d80990e0f907be7799c6449afd6cd19502d604 - sale: at least since https://github.com/odoo/odoo/commit/43977deb713ef8df02690d9000f9becff8d9d610 This commit also reverts: https://github.com/odoo/odoo/commit/98428145c4917bfcf8436569ab7560524d957880 Which is actually the reason why this commit is written: we should not have to give those rights to a PoS user Forward-Port-Of: odoo/odoo#205569 Forward-Port-Of: odoo/odoo#204512
Steps to reproduce the issue: - Enter Website edit mode. - Click on the "Theme" tab. - Pick a black color for the website background (4th color button). - Click on a link in the website navbar to make the link popover appear. - Bug: The popover arrow is black. Bug introduced by this commit [1], where popover colors were updated to match the website's theme. It was fixed since version 17.0 by this commit [2]. But during the forward-port to saas-17.4, the fix no longer works because of t
Original PR description
Steps to reproduce the issue: - Enter Website edit mode. - Click on the "Theme" tab. - Pick a black color for the website background (4th color button). - Click on a link in the website navbar to make the link popover appear. - Bug: The popover arrow is black. Bug introduced by this commit [1], where popover colors were updated to match the website's theme. It was fixed since version 17.0 by this commit [2]. But during the forward-port to saas-17.4, the fix no longer works because of the upgrade to Bootstrap 5.3 done in this commit [3]. In this commit, we adapt the CSS code introduced by commit [2], so that it fixes the arrow color in the same way as it does in 17.0. [1]: https://github.com/odoo/odoo/commit/0d96be06faf8aad1a92183bd2b6371253980c7e6 [2]: https://github.com/odoo/odoo/commit/bf59d2aba488931ba89512d5d6489ecb48ef2aa3 [3]: https://github.com/odoo/odoo/commit/058212e12b5079eba870bde9775fe98f27928935 task-4422810 Forward-Port-Of: odoo/odoo#205317
When printing a delivery order with a kit product that has a BoM with a product template (not a product_id) and a packaging quantity, we encounter a traceback due to the conversion of the quantity from the product's UoM to the order line's UoM. This happens because the product's UoM is not defined. Steps to reproduce the bug: - Create a storage “P1”: - UoM: Kg - Create a storable “Kit 1”: - UoM: unit - BoM: - set only the product template field (not the product_id)
Original PR description
When printing a delivery order with a kit product that has a BoM with a product template (not a product_id) and a packaging quantity, we encounter a traceback due to the conversion of the quantity…
When printing a delivery order with a kit product that has a BoM with a product template (not a product_id) and a packaging quantity, we encounter a traceback due to the conversion of the quantity from the product's UoM to the order line's UoM. This happens because the product's UoM is not defined.
Steps to reproduce the bug:
- Create a storage “P1”:
- UoM: Kg
- Create a storable “Kit 1”:
- UoM: unit
- BoM:
- set only the product template field (not the product_id)
- 1 Kg of P1
- Create a delivery order for 1 unit of Kit 1
- Mark it as to do
- Set the quantity of P1 to 1kg
- try to print
Problem:
A traceback is triggered because we try to convert 1kg to an undefined uom
```
Error while render the template
UserError: The unit of measure Units defined on the order line doesn't
belong to the same category as the unit of measure False defined on
the product. Please correct the unit of measure defined on the order
line or on the product. They should belong to the same category.
```
opw-4619140
Forward-Port-Of: odoo/odoo#205502During post-install tests, run the following code in a python terminal: import socket, time with socket.create_connection(('127.0.0.1', 8069)): time.sleep(6) It opens a socket and connect to the running odoo server, but does nothing. After 5 seconds the odoo server closes the socket with a timeout. The timeout is only set during tests in ``RequestHandler.setup``, and it set to a hardcoded value of 5 seconds. Since Werkzeug 2.1.0[^1], it logs an error in the logs. We wa
Original PR description
During post-install tests, run the following code in a python terminal: import socket, time with socket.create_connection(('127.0.0.1', 8069)): time.sleep(6) It opens a socket and connect to the…
During post-install tests, run the following code in a python terminal:
import socket, time
with socket.create_connection(('127.0.0.1', 8069)):
time.sleep(6)
It opens a socket and connect to the running odoo server, but does nothing. After 5 seconds the odoo server closes the socket with a timeout.
The timeout is only set during tests in ``RequestHandler.setup``, and it set to a hardcoded value of 5 seconds. Since Werkzeug 2.1.0[^1], it logs an error in the logs. We want to get rid of that error log.
Those errors can occur when the test chrome browser is killed while it was performing http requests. Chrome doesn't TCP RST the sockets and just let those sockets die.
The socket timeout error actually cannot occurs in production, as all traffic is routed via nginx, and nginx will only proxy the connection to Odoo once nginx has all the requests headers.
That error log is silly, it is now ignored.
[^1]: pallets/werkzeug:d062807
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#204023
Forward-Port-Of: odoo/odoo#203757The demo product 'Drawer' was initially configured to be tracked by quantity, but a lot was incorrectly created, and the stock quant was subsequently created for the 'Drawer' with lot. Steps to reproduce =============== - Install the 'stock' module with demo data. - Navigate to Inventory > Products > Products and search for 'Drawer'. - Observe that 'Drawer' is set to track by quantity (Tracking field). - Check Inventory > Operations > Physical Inventory and locate the stock quant
Original PR description
The demo product 'Drawer' was initially configured to be tracked by quantity, but a lot was incorrectly created, and the stock quant was subsequently created for the 'Drawer' with lot. Steps to reproduce =============== - Install the 'stock' module with demo data. - Navigate to Inventory > Products > Products and search for 'Drawer'. - Observe that 'Drawer' is set to track by quantity (Tracking field). - Check Inventory > Operations > Physical Inventory and locate the stock quant for 'Drawer'. - Note that a lot exists and is linked to the product 'Drawer', despite the quantity tracking setting. This commit modifies the demo data to enable lot tracking for the product, aligning its configuration with the existing lot and stock quant data for consistency. Forward-Port-Of: odoo/odoo#204803
Some website appointment pages are showing the wrong price, always using the price of the first variant it finds, not the current one. The issue was introduced in Odoo 18.0 with commit [1]. - Create a product.template, add it some variants and for each variants have a different price (eg through the variant extra price). - That product should be a service one - Create an appointment, enable "Up-front payment" in the "Options" tab and add it one of the variant product. Note that it's a vari
Original PR description
Some website appointment pages are showing the wrong price, always using the price of the first variant it finds, not the current one. The issue was introduced in Odoo 18.0 with commit [1]. - Create…
Some website appointment pages are showing the wrong price, always using the price of the first variant it finds, not the current one. The issue was introduced in Odoo 18.0 with commit [1]. - Create a product.template, add it some variants and for each variants have a different price (eg through the variant extra price). - That product should be a service one - Create an appointment, enable "Up-front payment" in the "Options" tab and add it one of the variant product. Note that it's a variant product that you set there, not a template. - You should see next to the variant product you just selected a price per booking being displayed. It is correctly showing the product variant price and not the product template price. - Repeat those 2 steps with the other product variants: create a new appointment and select another variant, you can see the price is correct in the form view. - Now, go to the website appointment page `/appointment`, you will see that all those appointments will show the same price which is the one from the first variant. - The same price error will appear once you click on an appointment (you should land on something like `/appointment/4?`) - Note that if you go further in the appointment booking and land on the shop cart page, the price will be correct there, using the correct variant one. (You'll need to assign a user on the appointment in the backend to be able to book a slot) Side note: Commit [1] seems to have broken commit [2] too. [1]: https://github.com/odoo/enterprise/commit/26fb20ace27b7b522a1105c221e4a52cf224a508#diff-5ffc6d13c61e692b22e4c2fec9218cf96c0c86201aeac951ef36e53e7baa7620R4-R9 [2]: https://github.com/odoo/enterprise/commit/5068b0ae7d38cb03318ad1e97124021121fd66cb opw-4678998 Forward-Port-Of: odoo/enterprise#83104
If you have multiple taxes on a sale order or invoice, then the total tax amount is displayed with the name of the first tax group. Rename it to show a generic "Taxes" group. This was done before for sale orders but was lost in d5da2b62263f85fbce0f2548085c066cbbf10371. opw-4673667 Forward-Port-Of: odoo/enterprise#83078
Original PR description
If you have multiple taxes on a sale order or invoice, then the total tax amount is displayed with the name of the first tax group. Rename it to show a generic "Taxes" group. This was done before for sale orders but was lost in d5da2b62263f85fbce0f2548085c066cbbf10371. opw-4673667 Forward-Port-Of: odoo/enterprise#83078
In this commit, we prefer to use click on element instead of press Tab because tab will directly focus the other range period input. Forward-Port-Of: odoo/enterprise#82937
Original PR description
In this commit, we prefer to use click on element instead of press Tab because tab will directly focus the other range period input. Forward-Port-Of: odoo/enterprise#82937
Description ----------- When clicking the sharing button on a knowledge article, the system retrieves all members linked to the article. This includes members directly tied to the article or inherited through parent articles ( stopping at the first desynchronized article). In databases where articles have numerous associated members, the `_get_article_member_permissions` method suffers from severe performance issues. It retrieves *all* articles and their associated members, collects all paren
Original PR description
Description ----------- When clicking the sharing button on a knowledge article, the system retrieves all members linked to the article. This includes members directly tied to the article or…
Description ----------- When clicking the sharing button on a knowledge article, the system retrieves all members linked to the article. This includes members directly tied to the article or inherited through parent articles ( stopping at the first desynchronized article). In databases where articles have numerous associated members, the `_get_article_member_permissions` method suffers from severe performance issues. It retrieves *all* articles and their associated members, collects all parent articles in the hierarchy, and only then applies grouping and filtering based on the `id` of `self`. This process includes a `LEFT OUTER JOIN` on related tables to fetch specific `fields` passed as arguments, resulting in an O(n^2) complexity on large tables such as `res.partner` and `knowledge.article.member` (the latter being a Many2many relationship that typically contains a high volume of rows). This patch improves performance by shifting the grouping and filtering logic to the start of the process, effectively injecting all preconditions at the base of the recursion. This reduces the hierarchy of articles and memberships to explore. Additionally, the computation of inherited permissions—sourced from the "closest" ancestor article—is now handled at the SQL level instead of Python. This eliminates unnecessary rows in the process, avoiding unnecessary work in the business logic afterward. Benchmark --------- On a client's database with around 600 articles, 5k partners and 15k knowledge.article.member in total, for a specific article which has a total of 1.7k members (direct and inherited): | Request | Before | After | Speed-up | |--------------------------------|---------|-------|-----------| | `_get_article_permission_data` | 4.7+min | 150ms | **1880x** | Reference --------- opw-4603551 Forward-Port-Of: odoo/enterprise#81264
…mesheet **Issue** In a subscription, the qty delivered of a SOL with "Prepaid" invoicing policy wasn't updated when timesheets were added. **Steps to reproduce** 1. Have a service subscription product with an invoicing policy "Prepaid/Fixed price" and creating a task on order. 2. Create a monthly subscription with a start date 15 days in the past 3. Add some timesheet hours on the task. 4. Run the "Subscription: generate recurring invoices" cron. - Actual: quantity delivered on th
Original PR description
…mesheet **Issue** In a subscription, the qty delivered of a SOL with "Prepaid" invoicing policy wasn't updated when timesheets were added. **Steps to reproduce** 1. Have a service subscription…
…mesheet **Issue** In a subscription, the qty delivered of a SOL with "Prepaid" invoicing policy wasn't updated when timesheets were added. **Steps to reproduce** 1. Have a service subscription product with an invoicing policy "Prepaid/Fixed price" and creating a task on order. 2. Create a monthly subscription with a start date 15 days in the past 3. Add some timesheet hours on the task. 4. Run the "Subscription: generate recurring invoices" cron. - Actual: quantity delivered on the SOL stays at 0. - Expected: timesheet hours falling during the subscription period are added to the delivered quantity of the line. **Cause** Commit https://github.com/odoo/enterprise/commit/a6420bdacab3b9c9f440f48db3b442e6b6c7b655 added a new module overwriting the computation of the delivered quantitiy for recurring lines based on timesheets, for products with an invoicing policy `delivered_timesheet`. However, the computation is overriden for all timesheet lines selected by https://github.com/odoo/enterprise/blob/a6420bdacab3b9c9f440f48db3b442e6b6c7b655/sale_subscription_timesheet/models/sale_order_line.py#L11-L12 A second filtering is applied later https://github.com/odoo/enterprise/blob/a6420bdacab3b9c9f440f48db3b442e6b6c7b655/sale_subscription_timesheet/models/sale_order_line.py#L21 Which exluces products with an invoicing policy different than `delivered_timesheet` **Solution** For products with a "prepaid" invoicing policy, compute the delivered quantities the same way: the timesheets delivered during the subscription period. Note that as explained in a comment, `Side effect: It won't work for the first period if the invoice cron never run. (the next invoice date has never been incremented)` opw-4509495 Forward-Port-Of: odoo/enterprise#82806
Before this commit, the `/iot/get_handlers` endpoint was using the `text/html` mime type, even though it was sending a binary zip response. This was mostly harmless, however it could potentially cause issues if there was some service between the IoT box and DB that assumed it was safe to modify the "text" response in some way. opw-4718821 Forward-Port-Of: odoo/enterprise#83315
Original PR description
Before this commit, the `/iot/get_handlers` endpoint was using the `text/html` mime type, even though it was sending a binary zip response. This was mostly harmless, however it could potentially cause issues if there was some service between the IoT box and DB that assumed it was safe to modify the "text" response in some way. opw-4718821 Forward-Port-Of: odoo/enterprise#83315