Book Image

Working with Odoo 10 - Second Edition

Book Image

Working with Odoo 10 - Second Edition

Overview of this book

Para 1: Take full advantage of the benefits of the Odoo module ecosystem whilst learning how to modernise your business with Working with Odoo 10. Covering everything from Odoo development essentials through to CRM and analytic accounting, this guide is a must-have for Odoo beginners. Para 2: A powerful set of open source enterprise management applications, Odoo 10 gives you access to a website builder, integrated e-commerce features, and a fast-growing community to allow you to transform your business. Para 3: With this Odoo book you?ll learn how to set up Odoo online, configure basic company settings, and then explore CRM in Odoo. You?ll cover all the Odoo development essentials and much more, including purchasing application, ERP systems, analytic accounting, and other recent Odoo features. Para 4: What?s Inside ? Understand Odoo installation & the basics of implementing Odoo in your business ? Explore accounting & finance setup and modules to help business efficiency ? Build a website with Odoo ? Customise and configure Odoo to an advanced level
Table of Contents (25 chapters)
Working with Odoo 10 Second Edition
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

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 to limit rush orders to use the API to return a list of sale order IDs that match:

    models...