Odoo Website - vec-ltd/odoo-docs GitHub Wiki

Odoo Website Architecture

Odoo has 3 main user types, and 3 main endpoints that serve them.

Note that any Odoo web session ALWAYS has a user from the database. Always. If you are not authenticated, you get assigned the ID of the "public" user. If you login, you get your own ID.

Each user that logs in is either a "portal" user, in which case they get access to the portal app which is hosted at the "/my" endpoint. Or you are an "internal" user, in which case you get access to the Odoo web client, which is hosted at "/web".

Odoo Web Client

This is the main feature of Odoo where 90% of the modules go. Most of what has been written in these docs speaks to the web client, and most of the customisation work is done here. This is where you can edit business processes and really tailor Odoo to your needs. It is also where 90% of OOTB functionality lives, so it is super-duper important.

Odoo Portal

However, with the Website module installed, we get access to another app hosted at "/my", which is available to "portal" users. Portal users do not take up one of the paying seats in Odoo's subscription model.

Basically you can think of portal users as your customers or other external entities you want to grant limited access to information in your systems. So for example, you could allow eCommerce customers to view their order history here, or you could allow 3rd party contractors to submit requests for a Purchase Order for materials (if you are a large construction company for example), or perhaps allow 3rd party logistic suppliers to submit a Credit Note for goods returned or that arrive at the warehouse damaged.

Odoo Website

The website module creates a way of resolving routes to XML templates. It goes like this:

First the DNS hostname is checked against the website table to find matching sites.

Once it does that, it looks in the website_page table for a matching url.

Once it finds the page, it looks for the corresponding XML template in the ir_ui_view table.

It then renders that using the QWEB templating engine. This is capable of executing arbitrary python code in an Odoo environment (i.e. you can access session data, query the ORM etc.). This is because the QWEB template is being resolved on the backend before being sent as an HTML document to the frontend.

You can also scope templates, CSS, JS or other assets to a particular website, by setting the website_id.