Search
Takes a search domain, returns a recordset of matching records. 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])
Parameters:
- args -- A search domain. Use an empty list to match all records.
- offset (int) -- number of results to ignore (default: none)
- limit (int) -- maximum number of records to return (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 up to limit.
Raise AccessError:
if user tries to bypass access rules for read on the requested object.
You just need to search in following manner with descending order.
sortBy = "field_name desc"
x = obj.search(cr, uid, criteria, offset=0,limit=36,order=sortBy)
###Or you can define directly
x = obj.search(cr, uid, criteria, offset=0,limit=36,order='field_name desc')