Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Working with Odoo 10

You're reading from   Working with Odoo 10 One stop guide for your enterprise needs

Arrow left icon
Product type Paperback
Published in Jan 2017
Publisher Packt
ISBN-13 9781786462688
Length 426 pages
Edition 2nd Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Greg Moss Greg Moss
Author Profile Icon Greg Moss
Greg Moss
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Setting Up Odoo 10 FREE CHAPTER 2. Installing Your First Application 3. Exploring Customer Relationship Management in Odoo 10 4. Purchasing with Odoo 5. Making Goods with Manufacturing Resource Planning 6. Configuring Accounting Finance 7. Administering an Odoo Installation 8. Implementing the Human Resources Application 9. Understanding Project Management 10. Creating Advanced Searches and Dashboards 11. Building a Website with Odoo 12. Implementing E-Commerce with Odoo 13. Customizing Odoo for Your Business 14. Modifying Documents and Reports 15. Discovering Custom Odoo Modules 16. Comparative Analysis of Community vs Enterprise Edition appA. Locating additional Odoo resources

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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $24.99/month. Cancel anytime