Listing record fields | Odoo External API | Odoo XMLRPC – CBMS Odoo ERP

Listing record fields | Odoo External API | Odoo XMLRPC – CBMS Odoo ERP

2
0 minutes, 46 seconds Read

fields_get() can be used to inspect a model’s fields and check which ones seem to be of interest. Because it returns a large amount of meta-information (it is also used by client programs) it should be filtered before printing, the most interesting items for a human user are ‘string’ (the field’s label), ‘help’ (a help text if available) and ‘type’ (to know which values to expect, or to send when updating a record)
#odooexternalapi #xmlrpc #odooxmlrpc

url = ”
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))
a = models.execute_kw(db, uid, password, ‘res.partner’, ‘fields_get’,[‘name’], {‘attributes’: [‘string’, ‘help’, ‘type’]})
print (“list”,a)

#Listing #record #fields #Odoo #External #API #Odoo #XMLRPC

Similar Posts

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *