Using scaffold to create a module
When creating a new Odoo module, there is some boilerplate that needs to be set up. To help quick start new modules, Odoo provides the scaffold command.
The recipe shows how to create a new module using the scaffold command, which will put in place a skeleton of the file directories to use.
Getting ready
We need Odoo installed and a directory for our custom modules.
We will assume that Odoo is installed at ~/odoo-dev/odoo and our custom modules will be at ~/odoo-dev/local-addons.
How to do it...
The scaffold command is used from the command line:
- Change the working directory to where we will want our module to be. This can be whatever directory you choose, but within an addons path to be useful. Following the directory choices used in the previous recipe, it should be as follows:
$ cd ~/odoo-dev/local-addons- Choose a technical name for the new module, and use the
scaffoldcommand to create it. For our example, we will choosemy_scaffolded:
$ ~/odoo-dev/odoo/odoo-bin...