Integrating with the Odoo API
Often, when developing custom applications, you are going to need to create solutions that involve interoperability with other systems and platforms. For example, perhaps you need to integrate with a third-party CRM application to create records inside of Odoo. The API is also quite useful for data migration.
Connecting to the API
Accessing the API is relatively easy. We begin with the code that imports the required libraries and creates a connection to the Odoo server:
import xmlrpclib url = 'http://localhost:8069' db = 'SILK-DEV' username = 'admin' password = 'admin' info = xmlrpclib.ServerProxy('https://localhost:8089/start').start() url, db, username, password = \ info['host'], info['database'], info['user'], info['password']
Filtering and returning records through the API
We can use our same domain filters that we used...