Creating and installing a new addon module
In this recipe, we will create a new module, make it available in our Odoo instance, and install it.
Getting ready
We will need an Odoo instance ready to use.
If the first recipe in Chapter 1, Installing the Odoo Development Environment, was followed, Odoo should be available at ~/odoo-dev/odoo
. For explanation purposes, we will assume this location for Odoo, although any other location of your preference could be used.
We will also need a location for our Odoo modules. For the purpose of this recipe, we will use a local-addons
directory alongside the odoo
directory, at ~/odoo-dev/local-addons
.
How to do it…
The following steps will create and install a new addon module:
Change the working directory in which we will work and create the addons directory where our custom module will be placed:
$ cd ~/odoo-dev $ mkdir local-addons
Choose a technical name for the new module and create a directory with that name for the module. For our example we will use my_module...