- Odoo 11 Development Cookbook(Second Edition)
- Holger Brunn Alexandre Fayolle
- 147字
- 2021-06-25 22:48:44
How it works...
The scaffold command creates the skeleton for a new module based on a template.
By default, the new module is created in the current working directory, but we can provide a specific directory to create the module, passing it as an additional parameter.
Consider this example:
$ ~/odoo-dev/odoo/odoo-bin scaffold my_module ~/odoo-dev/local-addons
A default template is used, but a theme template is also available for website theme authoring. To choose a specific template, the -t option can be used. We are also allowed
to use a path for a directory with a template.
This means that we can use our own templates with the scaffold command. The built-in themes can be used as a guide, and they can be found in the ./odoo/cli/templates Odoo subdirectory. To use our own template, we can use something like this:
$ ~/odoo-dev/odoo/odoo-bin scaffold -t path/to/template my_module