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.
Module Structure in Odoo13
Following directories, sub-directories and files are automatically created after the successful creation of the odoo13 module.
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 __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.
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
What is views directory
- views.xml
- template.xml
What is controller directory
What is the static directory
- description
- src
Why we use the description
Why we use src
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
Recommend:
What is the security directory
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. |
2 Comments
nice tutorial
ReplyDeletethanks, keep sharing keep learning
Delete