Using the scaffold command to create a module
When creating a new Odoo module, there is some boilerplate code that needs to be set up. To help quick-start new modules, Odoo provides the scaffold
command.
This recipe shows you how to create a new module using the scaffold
command, which will put in place a skeleton of the file for directories to use.
Getting ready
We will create the new add-on module in a custom module directory, so we need Odoo installed and a directory for our custom modules. We will assume that Odoo is installed at ~/odoo-dev/odoo
and that our custom modules will be placed in the ~/
odoo-dev/local-addons
directory.
How to do it...
We will use the scaffold
command to create boilerplate code. Perform the following steps to create new a module using the scaffold
command:
- Change the working directory to where we will want our module to be. This can be whatever directory you choose, but it needs to be within an add-on path to be useful. Following...