Search and read API methods
We have seen, in Chapter 7, Recordsets – Working with Model Data, the most important model methods used to generate recordsets and how to write to them. But there are a few more model methods available for more specific actions, as shown here:
read([fields])
is similar to thebrowse
method, but, instead of a recordset, it returns a list of rows of data with the fields given as its argument. Each row is a dictionary. It provides a serialized representation of the data that can be sent through RPC protocols and is intended to be used by client programs and not in server logic.search_read([domain], [fields], offset=0, limit=None, order=None)
performs a search operation followed by a read on the resulting record list. It's intended to be used by RPC clients and saves them the extra round trip needed when doingsearch
followed byread
on the results.
All other model methods are exposed through RPC, except for the ones prefixed with an underscore, which are considered...