Search Here

Understanding Module Structure Odoo13

In this article, you will learn the structure of the module. When we create a new custom module in Odoo13 using the odoo-bin scaffold command, then in return a module has been created in our selected location. Before directly jump into the coding we need to understand the structure of the newly create module.

Understanding Module Structure Odoo13

Module Structure in Odoo13

Following directories, sub-directories and files are automatically created after the successful creation of the odoo13 module.

Understanding Module Structure Odoo13

What is __init.py__

In __init.py__ file, we have to register our directory(contain .py files) or python files. We can say that before using these directories and python files we tell the __init.py__ the file that we are going to use such folders or files (model, example.py) so register them.

What is __init.py__

What is __manifest.py__

In the lower version of Odoo like odoo8 uses __openerp.py__ file instead of __manifest.py__. In Odoo13 every module must have this (__manifest.py__) file, and this file located in the root of the directory. This file contains all the information related to the current module. The following table shows how you declare or use such information.

What is __manifest.py__



Field Description
name Name of the module
description Brief description of the module
version Specify the version of the module
license Specify the distribution license of the module
author Author name of the module
website Website URL of the module author
category Specify the category name
depends Specifies a list of modules which install first before installing the module
data List of the data files which are always installed or updated with the module
demo List of the data files which are installed or updated in active demonstration mode

What is the models directory

This directory holds all your business logic (python files). Business logic means Odoo classes or models (In Odoo models are database tables that contain fields (table columns)). These models can be our newly created model as well as the inherited model (given by odoo13).

What is the models directory

What is views directory

View directory contains two types of files.
  • views.xml
  • template.xml
In Odoo13 to display fields, buttons, or view of any model we use XML. So views directory contain all of our .xml files. We have different types of views in Odoo like form view, tree view, kanban view, etc. Templates are also .xml files. We use a template to create web pages and QWEB reports in Odoo13.

What is views directory

What is controller directory

Like the models directory, the controller directory also contains .py files. In Odoo controller is a python class that is derived from the base class. Controllers are used to creating APIs, requests like GET and POST and to connect external applications like PHP, Android, and iOS using XML-RPC.

What is the static directory

If this directory is not available in your newly created module, you can create this one manually. This directory contains two sub-directories.
  • description
  • src

Why we use the description

This will contain two files, the first one is icon.png that represent the module icon. And the other one is the index.html file, this file represents documentation of the current module.

Why we use src

All of our images, js, and CSS file goes here.


File Name Purpose
scss store one or more SCSS file for applying styles
css store one or more CSS file for applying styles
img store images which are we used in a module
js contains one or more JavaScript files

What is the demo directory

This directory contains .xml files, and these XML files are used to load demo data like country name, state name, etc. Remember these XML files are updated only when you have enabled the "checked demo data" checkbox at the time of database creation. And when you install your module these files loaded and store the record in the database.


What is the security directory

By default, this folder contains only one CSV file named ir.model.access.csv. But usually, this folder has another file to creating record rules (.xml file).


File Purpose
ir.model.access.csv Used for access control for your model. Access control means giving access control or permission to users for particular model.
security.xml Used to create record rules. As compare to access rule, record rules are apply on record level instead of model.

Post a Comment

2 Comments