
Odoo 15 Development Essentials
By :

A recordset is a collection of records, and Python business logic frequently needs to use them. There are several operations that can be performed on recordsets, such as mapping and filtering. We can also compose new recordsets by adding or removing records. Other common operations are inspecting the contents of a recordset to check if a particular record is there or not, for example.
Changes in Odoo 10
Since Odoo 10, recordset manipulation has preserved the record order. This is unlike previous Odoo versions, where recordset manipulation was not guaranteed to preserve the record order, although addition and slicing maintained the record order.
Recordsets have a few functions available to perform useful actions on them, such as sorting or filtering records.
These are the supported functions and attributes:
recordset.ids
attribute returns a list with the IDs of the recordset elements.recordset.ensure_one...