When we face any issue in database records value at that situation we use read records value and record data is accessible with the read() method, which takes a list of ids (as returned bysearch()) and optionally a list of fields to fetch. And by default, it will fetch all the fields that the current user can read, which tends to be a huge amount and insert the database value. For example you can see the below code.
ids = models.execute_kw(db, uid, password,
'res.partner', 'search',
[[['is_company', '=', True], ['Test', '=', 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- With the help of this code we can insert the database value easily in Odoo9.
0 Comment(s)