diff --git a/content/developer/reference/backend/orm.rst b/content/developer/reference/backend/orm.rst index 638cd9d728..f2d351c8de 100644 --- a/content/developer/reference/backend/orm.rst +++ b/content/developer/reference/backend/orm.rst @@ -1086,13 +1086,17 @@ Map .. note:: - Since V13, multi-relational field access is supported and works like a mapped call: + Accessing relational attributes returns the union of the recordsets. + You should probably always use simple attribute access and only ``mapped`` + when you may have multiple records and you want to get a value for each + record in the recordset. .. code-block:: python3 - records.partner_id # == records.mapped('partner_id') - records.partner_id.bank_ids # == records.mapped('partner_id.bank_ids') - records.partner_id.mapped('name') # == records.mapped('partner_id.name') + records.partner_id # union of partner_id from records + records.mapped('partner_id') # same as previous + records.partner_id.bank_ids # union of banks of partners of records + records.partner_id.mapped('name') # for each partner of records, get the name Sort ~~~~ diff --git a/content/developer/reference/backend/orm/changelog.rst b/content/developer/reference/backend/orm/changelog.rst index 6614540700..071c60c7da 100644 --- a/content/developer/reference/backend/orm/changelog.rst +++ b/content/developer/reference/backend/orm/changelog.rst @@ -10,6 +10,8 @@ Odoo Online version 18.1 - Declare constraints and indexes as model attributes with `#175783 `_. - The `json` controllers have been renamed to `jsonrpc`. They are called the same, only the `type` in the python files changed. See `#183636 `_. +- Models' `mapped` and `filtered` stop accepting paths as strings. + See `#187299 `_. Odoo version 18.0 ================= diff --git a/content/developer/tutorials/pdf_reports.rst b/content/developer/tutorials/pdf_reports.rst index 77717e98fd..4cca73ad6b 100644 --- a/content/developer/tutorials/pdf_reports.rst +++ b/content/developer/tutorials/pdf_reports.rst @@ -124,7 +124,7 @@ our minimal property offers template file: - +