Daily updates from Odoo
Saturday, April 26, 2025
2 changes · saas-18.2
Miscellaneous changes
Before this fix, there was a non-deterministic error in the main flow tour : ´Uncaught (in promise)undefined´. This issue occured when the loading of "jsvat" took too much time. The user could have time to click on one of the results, which then caused the destruction of the component before the loading was finish. Then after the loading, there is a call to the "ORM service" in ´getSuggestions´ but no luck the component is already destroyed. This error therefore typically occurs in a to
Original PR description
Before this fix, there was a non-deterministic error in the main flow tour : ´Uncaught (in promise)undefined´. This issue occured when the loading of "jsvat" took too much time. The user could have…
Before this fix, there was a non-deterministic error in the main flow tour : ´Uncaught (in promise)undefined´. This issue occured when the loading of "jsvat" took too much time. The user could have time to click on one of the results, which then caused the destruction of the component before the loading was finish. Then after the loading, there is a call to the "ORM service" in ´getSuggestions´ but no luck the component is already destroyed. This error therefore typically occurs in a tour depending on : - the quick selection of a result as soon as it appears (thx to the tour) - the slow network that delays the loading of the lib (nightly builds) It is likely that this error has been there for longer but was highlighted by changes that affected these timings. Even if the migration from Clearbit to Dun & Bradstreet [1] would be a good culprit. In this case the main flow tour was impacted with steps flagged "mobile" only at the stage of creating an opportunity in the CRM. But we doesn't exclude to have the same issue for largest screens. [1] https://github.com/odoo/odoo/pull/202546 runbot-error: 161434 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#207472
### Issue: The operator `<` is not supported between `New` records. However, the `_compute_average_price` sorts a record set by `id`: https://github.com/odoo/odoo/blob/61b20ddc1646b1a1d81d39bcde688f4e3d5d7425/addons/stock_account/models/product.py#L803-L804 This raises a traceback if these records are New. ### Steps to reproduce: - Install stock_account, sale_stock, purchase - Enable sale margins and dropshipping - Create a storable product tracked by Serial numbers: - invoicing po
Original PR description
### Issue: The operator `<` is not supported between `New` records. However, the `_compute_average_price` sorts a record set by `id`:…
### Issue:
The operator `<` is not supported between `New` records. However, the `_compute_average_price` sorts a record set by `id`: https://github.com/odoo/odoo/blob/61b20ddc1646b1a1d81d39bcde688f4e3d5d7425/addons/stock_account/models/product.py#L803-L804 This raises a traceback if these records are New.
### Steps to reproduce:
- Install stock_account, sale_stock, purchase
- Enable sale margins and dropshipping
- Create a storable product tracked by Serial numbers:
- invoicing policy: delivered quantities
- costing method of the product category: standard
- Use the dropshipping route and a set a vendor
- Create and confirm a sale order for 1 unit
- Confirm the associated PO
- On the associated dropship add a new line with a demand of 0 for one more unit of your tracked product
- Assign a serial number on both moves
- Try to validate the dropship picking
#### > Traceback: `<` not supported between instnaces of `NewId` and `NewId`
### Fix:
We can not remove the lambda method used in the sorted here: https://github.com/odoo/odoo/blob/61b20ddc1646b1a1d81d39bcde688f4e3d5d7425/addons/stock_account/models/product.py#L803-L804 Because even if the `_order` of `stock.valuation.layer` model is `create_date, id`:
https://github.com/odoo/odoo/blob/61b20ddc1646b1a1d81d39bcde688f4e3d5d7425/addons/stock_account/models/stock_valuation_layer.py#L17 for real records, it and even if the `sorted` method relies on this order for real records: https://github.com/odoo/odoo/blob/19ae561098369739258a00af52582164551920ec/odoo/models.py#L6335-L6339 it is not supported for new records.
opw-4712087
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#206692