In record data is accessible via the read() method, which takes a list of ids (as returned by search()) and optionally a list of fields to fetch.
ids = models.execute_kw(db, uid, password,
'res.partner', 'search',
[[['is_company', '=', True], ['customer', '=', True]]],
{'limit': 1})
[record] = models.execute_kw(db, uid, password,
'res.partner', 'read', [ids])
# count the number of fields fetched by default
len(record)
Note- id field is not requested, it is always returned.
0 Comment(s)