Development Book V17: Scaffold command

It is the process of creating a skeletal structure for a module in Odoo. Using Odoo scaffolding, we can automatically design module structures. It saves a significant amount of time. Typically, a module is a directory within a module directory. The module path is specified by the addons path. Let us see how it is done. Let us begin by creating a new module under /opt/odoo/custom add-ons, such as custom add-ons. To create a module structure, we must navigate to the Odoo-bin location using the terminal.

To create a sample module structure, use the scaffold command. The command is as follows.

./odoo-bin scaffold module_name folder_name

module_name: The module's name.

Normally, A module is a directory within a module directory. The addons path specifies the module path. To begin, create a new module in /opt/odoo/custom addons, such as custom addons. To create a module structure, we must first use the terminal to navigate to the odoo-bin location. To generate a module structure automatically, execute the following command:

./odoo-bin scaffold new_module custom_addons

By running the above command, a new module with some directories is created.

odoo-creating-odoo-modules

Module expanded view

odoo-creating-odoo-modules

Each module requires two Python files: '__init__.py' and '__manifest__.py'.

As shown in the preceding image, each directory within the module will be created on its own. It is possible to change the required content.

Models are the Python files contained within the module.

Views are XML files used in the display of records.

Data consists of demo data required by the module. It includes XML that creates and updates databases.

The security file is made up of access rights configuration files.

The __init__.py file imports all of the module's Python files.

Controllers are used when we need to render data to the website.

whatsapp
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message