Chapter 3 - Odoo 15 Development Book

Scaffold command

Scaffolding in Odoo is the process of creating a skeletal structure for a module. We can design the module structure automatically using Odoo scaffolding. It saves us a lot of time and works as compared to manually constructing a module. A module is usually a directory within a module directory. Addons path specifies the module path. To begin, you can build a new module under /opt/odoo/custom add-ons, such as custom add-ons. To create a module structure, we must first travel to the Odoo-bin location using the terminal.

Enter the scaffold command we can create a sample module structure. The command is


                            ./odoo-bin scaffold module_name folder_name
                            

module_name: Name of the module

folder_name: Name of the directory inside which you need to create the module.

In usual cases, Within a module directory, a module is a directory. Addons path specifies the module path. To begin, create a new module in /opt/odoo/custom addons, for example, custom addons. To create a module structure, we must first travel to the odoo-bin location using the terminal. To automatically generate a module structure, run the following command:


                            ./odoo-bin scaffold new_module custom_addons
                            

Executing the above command, create a new module with some directories.

odoo-crm

Expanded view of the module

odoo-crm

Each module contains required python files; they are ‘__init__.py’ and ‘__manifest__.py’ files.

Here, we can see that every directory inside the module will be generated by itself. You can make changes to the content that is required.

1. The models are the python files contained within the module.

2. The XML files which help to display the records are views.

3. Data contains demo data that are needed in the module. It consists of XML that creates/updates databases.

4. The security file contains the configure files of access rights.

5. __init__.py file is import all the python files defined in the module.

6. When we need to render data to the website, we use controllers. The functionality of the models, for example, is insufficient to display the sale order data on the website. In such circumstances, front-end modules must be integrated with the backend. Controllers are used to configuring front-end modules, so to speak.

whatsapp
location

Calicut

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

location

London

Cybrosys Limited
Alpha House,
100 Borough High Street, London,
SE1 1LB, United Kingdom

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