Understanding Odoo Web Client Architecture

In this tutorial, you will learn how Odoo web client works under the hood. A simple diagram will be presented to give you a better understanding about the Odoo Architecture both the website (frontend) and web client (backend) architecture of Odoo.

Website / Backend Architecture

The diagram below pertains to the Website module or the frontend side of Odoo wherein it is using an MVC pattern, we have a model, a view, and a controller. Evereytime a user or a visitor accesses a link or a route, will be handled by the controller. The controller will then get the data from the model and will then send back the data with the view to the public user.

Odoo Website Architectre - MVC Pattern

Web Client (Backend) Architecture

For the Odoo web client (backend), it is a Single Page Application (SPA) that's why it is different. Before you go to the web client, you need to login first and until your're not logged in, you will not be redirected to the web client. If, yes, then the single page application will be rendering the default home screen.

Odoo Web Client Architectre - SPA

Then the user will access a menu or submenu. This part is like the route in the previous diagram, however, the creation will be different since menus are being saved in the database. A menu will then have an action which can either be a client action or a window action. Although there are other action types, we are only interested in views.

The difference between a client action and window action is that the client action has more freedom where in you can create the layout you want as well as the functionalities. Whereas a window action is the structured view of a model that you can set some rules. You just define the model fields and the viewwill be rendered automaticaly. This is harder to set up since this can be used by any model.

In addtion, window actions let you add different view types necessary for a certain model. This can be a list view, form view, graph view, etc. Most of the default requirements can be achieved by the list of default views Open added by Odoo in the community edition.

However, if you want to create a new view type, like the map view in the enterprise version, you need to create the three parts that completes a model view. These are the controller, Model, and Renderer. Open

To learn more, watch the video below.