How to use Odoo search_read () | Odoo XML RPC | External API
Odoo provides a search_read() shortcut which as its name suggests is equivalent to a search() followed by a read() but avoids having to perform two requests and keep ids around
#odooexternalapi #xmlrpc
url = "http://localhost:8041"
db = 'test_local_enterprise_db'
username = '14'
password = '14'
import xmlrpc.client
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
version = common.version()
print("version", version)
uid = common.authenticate(db, username, password, {})
print("uid = ",uid)
models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url))
search_read = models.execute_kw(db, uid, password,'res.partner', 'search_read',[[]],{'fields': ['name', 'country_id', 'comment'], 'limit': 5})
print("search_read",search_read)