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

Using Odoo to create websites and web services


In the previous examples, we have been extending the Odoo framework to include additional fields in the models and functionality in our views. Odoo also provides a powerful framework for creating your own websites and web services that can integrate easily with Odoo applications.

Let's see how we can create a simple web service that displays the rush orders on a page.

We begin by creating a controller that is tied to a URL. When we navigate to this URL in our browser, the controller will do whatever processing we require.

Create the controller file using the following command in your terminal window:

sudo nano controller.py

Add in the following code to create a simple output so we can test our controller and make sure it is functioning properly.

Place this code in the controller.py file:

    from odoo import http 
 
    class Web_RushOrders(http.Controller): 
        @http.route('/orders/rush/', auth='public') 
        Def index(self, **kw): 
  ...