Here is my code:
models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url))
product_id = models.execute_kw(db, uid, password, 'product.template', 'search',
[[['default_code', '=', 'X8591']]])
print("Product Id is: ", product_id)
record = models.execute_kw(db, uid, password,
'product.template', 'read', [product_id], {'fields':
['id', 'name', 'default_code', 'display_name', 'description']})
print("Record Details are: ",record)
# search the another project
print("Trying to get details of X-Ray position poster - Canine")
new_id = models.execute_kw(db, uid, password,
'product.template', 'search',[[['name', 'ilike', 'X-Ray position poster - Canine']]])
print("New Id: ", new_id)
record = models.execute_kw(db, uid, password,
'product.template', 'read',[new_id], {'fields': ['id', 'name', 'default_code',
'display_name', 'description']})
print("Details:", record)
Here is the output:
Here is the record in Odoo:
I have verified that the ID of the record shown in Odoo is in fact ID 5927 and that it is a product.template record, not a product.product record.