Book Image

Odoo Development Essentials

Book Image

Odoo Development Essentials

Overview of this book

Table of Contents (17 chapters)
Odoo Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing third-party modules


Making new modules available in an Odoo instance so they can be installed is something that newcomers to Odoo frequently find confusing. But it doesn't have to be so, so let's demystify it.

Finding community modules

There are many Odoo modules available from the Internet. The apps.odoo.com website is a catalogue of modules that can be downloaded and installed in your system. The Odoo Community Association (OCA) coordinates community contributions and maintains quite a few module repositories on GitHub, at https://github.com/OCA/

To add a module to an Odoo installation we could just copy it into the addons directory, alongside the official modules. In our case, the addons directory is at ~/odoo-dev/odoo/addons/. This might not be the best option for us, since our Odoo installation is based on a version controlled code repository, and we will want to keep it synchronized with the GitHub repository.

Fortunately, we can use additional locations for modules, so we can keep our custom modules in a different directory, without having them mixed with the official addons.

As an example, we will download the OCA project department and make its modules available in our Odoo installation. This project is a set of very simple modules adding a Department field on several forms, such as Projects or CRM Opportunities.

To get the source code from GitHub:

$ cd ~/odoo-dev
$ git clone https://github.com/OCA/department.git -b 8.0

We used the optional -b option to make sure we are downloading the modules for the 8.0 version. Since at the moment of writing 8.0 is the projects default branch we could have omitted it.

After this, we will have a new /department directory alongside the /odoo directory, containing the modules. Now we need to let Odoo know about this new module directory.

Configuring the addons path

The Odoo server has a configuration option called addons-path setting where to look for modules. By default this points at the /addons directory where the Odoo server is running.

Fortunately, we can provide Odoo not only one, but a list of directories where modules can be found. This allows us to keep our custom modules in a different directory, without having them mixed with the official addons.

Let's start the server with an addons path including our new module directory:

$ cd ~/odoo-dev/odoo
$ ./odoo.py -d v8dev --addons-path="../department,./addons"

If you look closer at the server log you will notice a line reporting the addons path in use: INFO ? openerp: addons paths: (...). Confirm that it contains our department directory.

Updating the module list

We still need to ask Odoo to update its module list before these new modules are available to install.

For this we need the Technical menu enabled, since the Update Modules List menu option is provided by it. It can be found in the Modules section of the Settings menu.

After running the modules list update we can confirm the new modules are available to install. In the Local Modules list, remove the Apps filter and search for department. You should see the new modules available.