Join the Odoo Inner Circle to view the premium video below.
Creating an Affiliate Program in Odoo
Introduction: Creating a custom affiliate application for OdooClass
Creating a website controller handle URL parameters
Storing URL parameters in website cookies
Modifying the XML of the subscription buttons
Debugging website controllers and view templates
Troubleshooting views that do not update
Using t-attf-href to set dynamic url parameters
Website controller @http.route for the video subscription page
Inherit from the page controller from website.controller class

Creating an Affiliate Program in Odoo

Odoo Inner Circle Only

This is the first of several videos that will demonstrate how to create an Affiliate Program in Odoo. See behind the scenes as you see the actual development of's new affiliate program. You will learn the correct way to add additional context to several CMS pages. You will learn how to create web controllers, perform URL routing, and develop an Odoo web application.

Video Length:   34 Minutes
Free With Odoo Inner Circle

What is an Affiliate Program and why would I want one?

From Wikapedia... An affiliate program is an automated electronic program that involves a Web advertiser and recruited webmasters. The webmasters, as affiliates, place the company's advertisements on their individually owned websites. The ads in affiliate programs are linked to company websites and are referred to as affiliate links. You want this because it helps increase sales.

Creating the foundation for an Affiliate Program

The affiliate program for OdooClass will be built up over several phases. In this video you will learn how to use Odoo's web services framework to capture through a specific route the affiliation link coming from a affiliate website.  Then the program you will write will check for the existence of the affiliate id and place it in a cookie so that it can be used to mark the sales process to the respective affiliate. 

Adds value to any website that sells products or services

Getting your product or service visible in today's market is not easy. While out-of-the-box Odoo provides great eCommerce features it does not offer any features that allow you to build out an affiliate network. Companies like Amazon owe much of their success to successful affiliate networks.  Now you can learn how to add your own affiliate network to any Odoo eCommerce site.

    How to Create a Web Controller in Odoo

    When creating a web controller in Odoo you can use the @route decorator to determine which URL's your application should respond to. In our video example we demonstrate how you can develop a web controller that can respond to a specific parameter.  

    You begin by creating route decorator and the function that will respond to the URL when there is a match. This is known as URL routing:

    @http.route('/page/<page:page>', type='http', auth="public", website=True, cache=300)
    def page(self, page, **opt):
         values = {'path': page, 'deletable': True,}
         # /page/website.XXX ---> /page/XXX
         # Your website controller code can now operate on the values
      Odoo text and image block

    Creating more Advanced Web Controllers in Odoo

    Where can I learn more about web controller  and URL routing in Odoo?

    Building a web application in Odoo often will require integrating with other services. In our affiliate system we must allow webmasters to embed a unique affiliate account # within the URL so that we can properly credit the commissions for the sale. Fortunately Odoo provides the framework for URL routing that is standard and has plenty of documentation. After you have watched the video and understand the basics there are several reference resources you can turn to when you need to create more advanced web controllers.

    Web Controller Reference Documentation: You can learn more about Odoo's web controller here.  While there are not many examples the documentation does give you the parameters you can use when constructing an Odoo web application. 

    URL Routing Documentation Like much of the Odoo framework, URL routing in Odoo is based on a common library known as Werkzeug.  Werkzeug is an HTTP and WSGI utility library for Python. You can learn more about URL routing here.

    Odoo image and text block

    Integrate Affiliate Marketing Into your Odoo Website

    Once you have a product or service attention typically turns to SEO and other methods in order to get traffic to your website. Many successful eCommerce companies however take it a step further. They offer commission to those who send them customers that purchase their products. This creates a win-win situation. Furthermore, affiliate marketing is often performance based instead of per-impression based marketing. If someone is advertising your product but not producing sales you don't have to pay any advertising expenses. Contrast this to banner advertisements in which you must pay for impressions or Google Adwords in which you pay for clicks that may never turn into sales.

    In this video you will get to learn how to build your own affiliate system in Odoo. Furthermore, we will be using this same design to implement an affiliate program for OdooClass. This 'Building OdooClass Series" will give subscribers behind the scenes look at real Odoo development. Not contrived examples but real-world Odoo solutions that power real eCommerce websites.