Recordset operations is used to make ids and function in Odoo module. The operation are given below.
ids
List of actual record ids in this recordset (ignores placeholder ids for records to create)
ensure_one()
Verifies that the current recorset holds a single record. Raises an exception otherwise.
exists() records
Returns the subset of records in self that exist, and marks deleted records as such in cache. It can be used as a test on records:
if record.exists():
...
By convention, new records are returned as existing.
filtered(func)
Select the records in self such that func(rec) is true, and return them as a recordset.
Parameters
func -- a function or a dot-separated sequence of field names
sorted(key=None, reverse=False)
// Return the recordset self ordered by key.
key -- either a function of one argument that returns a comparison key for each record, or None, in which case records are ordered according the default model's order
reverse -- if True, return the result in reverse order
0 Comment(s)