Wednesday, May 28, 2025
2 changes · saas-18.1
Resolved issues and error corrections
This update replaces a slower internal way of collecting record IDs with a safer standard approach. It helps prevent errors when working with newly created records, especially in filters and database operations, while improving performance slightly across affected areas.
Original PR description
Description of the issue/feature this PR addresses:
Replace all usages of `mapped('id')` by `ids`.
The former is slower and does not work in domains because NewId is not a valid value for psycopg.
Current behavior before PR:
The `mapped` call returns `.id` for each record, which on new records returns a NewId. That value is not supported in domains or as SQL parameters. (impacted modules: at least l10n_uk*)
Desired behavior after PR is merged:
Simply use `.ids`.
odoo/enterprise#86275
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThis update corrects a shared technical issue that could affect how records are identified across several Odoo applications. It helps prevent errors in accounting, recruitment, documents, payments, signing, and inventory workflows without changing user-facing features.
Original PR description
odoo/odoo#211391