Search
Searches for domain , returns a recordset of matching records. It can return a subset of matching records (offset and limit parameters) and be ordered (order parameter):
Syntax:
search(args[, offset=0][, limit=None][, order=None][, count=False])
Options:
- args is the search domain. Use an empty list to match all entries.
- offset (int) - the number of results to ignore (default: none)
- limit (int) - maximum number of returned records (default: all)
- order (str) - sort string
- count (bool) - if True, only counts and returns the number of matching records (default: False)
Returns . Returns records matching the search criteria to the limit.
Raise AccessError : if the user is trying to bypass the access rules for reading on the requested object.
You just need to search in descending order.
sortBy = "field_name desc" x = obj.search(cr, uid, criteria, offset=0,limit=36,order=sortBy)
source share