- Odoo 11 Development Cookbook(Second Edition)
- Holger Brunn Alexandre Fayolle
- 210字
- 2021-06-25 22:48:44
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 scaffold command to create it. For our example, we will choose my_scaffolded:
$ ~/odoo-dev/odoo/odoo-bin scaffold my_scaffolded
- Edit the __manifest__.py default module manifest provided and change the relevant values. You will surely want to at least change the module title in the
name key.
This is how the generated addon module should look like:
$ tree my_scaffolded
my_scaffolded
├── controllers
│ ├── controllers.py
│ └── __init__.py
├── demo
│ └── demo.xml
├── __init__.py
├── __manifest__.py
├── models
│ ├── __init__.py
│ └── models.py
├── security
│ └── ir.model.access.csv
└── views
├── templates.xml
└── views.xml
You should now edit the various generated files and adapt them to the purpose of your new module.