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 starting 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 files 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:

  1. 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 ...

Get Odoo Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.