In Odoo, a module is a set of files that extends the functionality of the Odoo system. Modules can add new features, customize existing ones, or modify the behavior of the system to better suit specific business needs. Each module typically includes Python files for the business logic, XML files for the user interface, CSV files for data import/export, and a manifest file that provides metadata about the module.
./odoo-bin scaffold my_module ~/path/to/addons
Replace my_module with your desired module name and ~/path/to/addons with the path to your addons directory.
The scaffold command will create a basic structure for your module, including files like
folder/my_module/
|-- __init__.py
|-- __manifest__.py
|-- controllers/
|-- |-- __init__.py
| |-- controllers.py
|-- demo/
| |-- demo.xml
|-- il8n/
|-- models/
| |-- __init__.py
| |-- models.py
|-- security/
| |-- ir.model.access.csv
|-- views/
| |-- templates.xml
| |-- views.xml
Edit the __manifest__.py file to include details about your module:
{
'name': 'My Module',
'version': '1.0',
'category': 'Custom',
'description': 'A custom module for Odoo 17',
'depends': ['base'],
'data': [
'security/ir.model.access.csv',
'views/views.xml',
'models/models.py',
],
}
The following is the composition you need to know in order to fill correctly
Available fields:
name | type | required | defaults |
---|---|---|---|
name | str | yes | |
version | str | no | |
description | str | no | |
author | str | no | |
website | str | no | |
license | str | no | LGPL-3 |
category | str | no | Uncategorized |
depends | list: str | no | |
data | list: str | no | |
demo | list: str | no | |
auto_install | bool or list: str | no | False |
external_dependencies | dict(key=list: str) | no | |
application | bool | no | False |
assets | dict | no | |
installable | bool | no | True |
maintainer | str | no | |
{pre_init, post_init, uninstall}_hook | str | no | |
auto_install | bool | no |