Daily updates from Odoo
Friday, November 7, 2025
9 changes · 17.0
Enhancements to existing features
This update makes bank statement checks run more efficiently by using a simpler database approach. It reduces processing time roughly by half, which helps large databases respond faster and lowers system load.
Original PR description
Description ----------- Avoid self-join of `account_bank_statement` that is done with a `Nested Loop` due to the `LATERAL`. Even if correlated, it requires two separate accesses to its index. Replaces it with a window function + `LAG` partitioned by the `journal_id`. This leads to a simpler plan (lower cost) and working in-memory instead of accessing disk pages (lower IO contention). Benchmark --------- On a database with 46k `account_bank_statement`, calling `_get_invalid_statement_ids` for all statements took: | [Before](https://explain.dalibo.com/plan/7605a4ddc42afbcf) | [After](https://explain.dalibo.com/plan/88d6ac1gee37aha3) | Speed-up | |--------|-------|----------| | 146ms | 72ms | 2x | --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Resolved issues and error corrections
This update fixes two issues in DHL shipment requests: a misspelled customer reference field and the shipping date/time format. As a result, DHL labels and return labels should now be created successfully without validation errors.
Original PR description
Currently, when creating a DHL shipment with an export declaration that includes a customer reference, there is a misspelling of the field 'recipientReference' as 'recepientReference'. This causes…
Currently, when creating a DHL shipment with an export declaration that includes a customer reference, there is a misspelling of the field 'recipientReference' as 'recepientReference'. This causes validation errors when communicating with the DHL API. In addition, the datetime format used for the planned shipping date and time does not conform to the expected format specified by DHL. Steps to reproduce spelling issue: 1. Create a Sales Order with a customer reference and a deliverable product. 2. Validate the SO. 3. Go to the delivery, select DHL as carrier, and confirm. → Error: Validation error #/content/exportDeclaration: extraneous key [recepientReference] is not permitted. Steps to reproduce datetime issue: 1. Create a delivery using the DHL carrier. 2. Confirm the delivery. 3. Return the delivery. 4. Click "Print Return Label". → Error: Bad request #/plannedShippingDateAndTime is not well formatted (expected format: '2010-02-11T17:10:09 GMT+01:00'). Official DHL documentation: https://developer.dhl.com/sites/default/files/2025-11/dpdhl-express-api-3.1.1_swagger.yaml opw-5024363
This update fixes the Italian translations and labels for document types used in electronic invoicing. It helps users see clearer, more accurate names when creating and managing these documents, reducing confusion and the risk of selecting the wrong type.
Original PR description
Simplified and fixed labels and labels translations. Ref: https://help.fattureincloud.it/help/articolo/544-crea-autofattura-elettronica Ref: https://fex-app.com/FatturaElettronica/FatturaElettronicaBody/DatiGenerali/DatiGeneraliDocumento/TipoDocumento
This fix ensures shipment updates sent to Amazon include the carrier code required by Amazon’s delivery schema in some countries. If the carrier cannot be identified, the system now sends a safe fallback so Amazon can still use the carrier name and process the update correctly.
Original PR description
The `POST_ORDER_FULFILLMENT_DATA` feed that is used to push order delivery info to Amazon should follow the `OrderFulfillment` schema (see https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/OrderFulfillment.xsd), but it was missing the `CarrierCode` element, which is required in some countries. This commit adds the missing element to the payload, with the formatted carrier name as a value. If the carrier name cannot be matched, "Other" is used as a fallback to signal Amazon that they should rely on the `CarrierName` instead.
When a sales order’s pricelist is updated, optional products will now have their prices recalculated as well. This prevents outdated or incorrect optional item pricing from appearing after the order price update, especially in cases where related products should be repriced to zero.
Original PR description
### Steps to reproduce: - Create a sale order with a SOL and an optional product - Preview the sale order and add the optional product to the order - Go back to edit mode and change the pricelist -…
### Steps to reproduce: - Create a sale order with a SOL and an optional product - Preview the sale order and add the optional product to the order - Go back to edit mode and change the pricelist - Click on 'Update Prices' - Notice the optional product price won't change ### Cause: When updating the prices of the SOLs we filter some lines that we won't recompute. Upon this commit https://github.com/odoo-dev/odoo/commit/2d919694d5c9588e0644d5ba82b15b9d3f762373 we remove the optional products from the recordset that will get price recomputation. If sale_subscription is installed we will set the product's prices to 0 https://github.com/odoo/enterprise/blob/85e0689ba12442e22e83f3337749c7ad2eb9d7d8/sale_subscription/models/sale_order.py#L674 so the price of the 'Optional product' SOL will change but will be equal to 0 ### Fix: An exception for the filtering has been introduced as we will recompute the price of the optional products only if the pricelist is getting changed opw-5058609
This change prevents a crash when the system finds more than one existing saved default for the same setting. It now picks a single matching record, so saving defaults works reliably instead of failing unexpectedly.
Original PR description
There’s no constraint preventing duplicate `ir.default` records. When setting a default using `self.env['ir.default'].set()`, it searches for an existing one, but if more than one match is found,…
There’s no constraint preventing duplicate `ir.default` records. When setting a default using `self.env['ir.default'].set()`, it searches for an existing one, but if more than one match is found, accessing `default.json_value` raises a singleton error.
This fix makes sure the search only picks one record, avoiding that crash.
Before fix:
```py
self: res.users(1,)
>>> company = self.company_id
>>> company
res.company(1,)
>>> self.env['ir.default'].create({'field_id': 4540, 'company_id': company.id, 'json_value': 7})
ir.default(9,)
>>> self.env['ir.default'].set('res.partner', 'property_account_receivable_id', 7, company_id=company.id)
Traceback (most recent call last):
File "/home/odoo/odoo/odoo/odoo/orm/models.py", line 5630, in ensure_one
_id, = self._ids
^^^^
ValueError: too many values to unpack (expected 1)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/odoo/odoo/odoo/odoo/addons/base/models/ir_default.py", line 107, in set
if default.json_value != json_value:
^^^^^^^^^^^^^^^^^^
File "/home/odoo/odoo/odoo/odoo/orm/fields.py", line 1670, in __get__
record.ensure_one()
File "/home/odoo/odoo/odoo/odoo/orm/models.py", line 5633, in ensure_one
raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: ir.default(4, 9)
```
After fix:
```py
self: res.users(1,)
>>> company = self.company_id
>>> company
res.company(1,)
>>> self.env['ir.default'].create({'field_id': 4540, 'company_id': company.id, 'json_value': 7})
ir.default(10,)
>>> self.env['ir.default'].set('res.partner', 'property_account_receivable_id', 7, company_id=company.id)
True
```
opw-5228419
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#234893This change prevents a crash that could happen when updating analytic details on a manufacturing order after a work order was completed, especially when multiple analytic plans were involved. It ensures the system handles these combinations correctly so users can save their changes without interruption.
Original PR description
## Issue:
When updating the analytic distribution on a manufacturing order with a completed work order, a traceback occurs if more than two analytic plans are set
## Cause:
When two plans already exist, the analytic distribution is stored as `{'1,2': 100}`. However, `_create_analytic_entry()` only supports a single ID per key This problem was already fixed in 18.0: https://github.com/odoo/enterprise/commit/c2648d6ff4a2f3e5234ff80a7f0ff77b2dbf4812
## Steps to reproduce:
- Enable Analytic Accounting in Settings
- Create a New Analytic Plan (Test Plan) with an Analytic Account (Test AA)
- Create a MO with one WO and confirm it
- Complete the WO (Start + Done)
- In the Miscellaneous Tab, set Analytic Distribution (Projects: Active account, Departments: Administrative), then Save
- Then modify Analytic Distribution to add Test Plan: Test AA
- A traceback is raised
opw-4835165This change ensures analytic entries keep working correctly when the project plan setting is changed in the system. It automatically updates the related internal fields so users no longer hit errors when confirming sales orders tied to projects.
Original PR description
A field on `account.analytic.line` is created for every plan using the `id` of the plan to make the names unique, like `x_plan{id}_id`. The plan that has the ID of the `analytic.project_plan`…
A field on `account.analytic.line` is created for every plan using the `id` of the plan to make the names unique, like `x_plan{id}_id`. The plan that has the ID of the `analytic.project_plan` parameter does not get a dynamic field, it uses `account_id`. If you change the system parameter for analytic.project_plan, the plan with the corresponding value will now use `account_id,` and the plan that corresponds to the previous default value will have no corresponding field on `account.analytic.line`.
So, when the project plan system parameter changes, the dynamic fields that are created for each analytic plan (apart from the project one) do not get updated.
Steps:
1. Set the `analytic.project_plan` system parameter to a value other than `1`
2. Enable `Analytic Accounting` setting under `Accounting > Analytic`
3. Create a sales order with a service product that creates a project.
4. Confirm sales order
5. Traceback: `ValueError: Invalid field account.analytic.line.x_plan1_id in leaf 'x_plan1_id', 'in', [23])`
We now extend the write method on `ir.config_parameter` so that when the value of the analytic.project_plan is changed the dynamic fields on `account.analytic.line` are properly added and removed. This solution always creates a field for the previous value and deletes a field for the new value so that no plan ever has two fields referencing it.
Ticket [link](https://www.odoo.com/odoo/project.task/5069381)
opw-5069381This update prevents an error that could appear when the browser’s push notification setup is manually reset. Odoo now waits for the background service to be fully active before reconnecting, which helps push notifications continue working reliably.
Original PR description
When you manually unregister the ServiceWorker linked to your Odoo,
you may receive a notification "Failed to enable push notifications".
This occurs because the ServiceWorker associated with the previous
subscription is gone and the browser has lost the link between the
subscription and the Odoo instance.
To handle this case, we ensure waiting the activated state of the
registration of the service worker before subscribing to the web push
notification.
Steps to reproduce:
- In Odoo, enable push notifications.
- Inside another tab, go to the internal Chrome URL:
chrome://serviceworker-internals/?devtools
- Unsubscribe the ServiceWorker linked to your Odoo instance.
- In the Odoo instance tab, press F5.
=> You will see an internal notification stating
"Failed to enable push notifications" => BUG.