Book Image

Odoo 10 Development Essentials

By : Daniel Reis
Book Image

Odoo 10 Development Essentials

By: Daniel Reis

Overview of this book

Odoo is one of the fastest growing open source, business application development software products available. With announcement of Odoo 10, there are many new features added to Odoo and the face of business applications developed with Odoo has changed. This book will not only teach you how to build and customize business applications with Odoo, but it also covers all the new features that Odoo has to offer. This book is the latest resource on developing and customizing Odoo 10 applications. It comes packed with much more and refined content than its predecessor. It will start with building business applications from scratch and will cover topics such as module extensions, inheritance, working with data, user interfaces, and so on. The book also covers the latest features of Odoo 10, in addition to front end development, testing and debugging techniques. The book will also talk about Odoo Community and Odoo Enterprise.
Table of Contents (20 chapters)
Odoo 10 Development Essentials
Credits
Foreword
About the Author
About the Reviewer
www.PacktPub.com
Preface

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 on the Internet. The Odoo apps store at apps.odoo.com is a catalogue of modules that can be downloaded and installed on 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 ones.

As an example, we will download the code from this book, available in GitHub, and make those addon modules available in our Odoo installation.

To get the source code from GitHub, run the following commands:

$ cd ~/odoo-dev
$ git clone https://github.com/dreispt/todo_app.git -b 10.0

We used the -b option to make sure we are downloading the modules for the 10.0 version.

After this, we will have a new /todo_app 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 to set where the server should look for modules. By default, this points to the /addons directory, where the Odoo server is running.

We can provide 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 that includes our new module directory:

$ cd ~/odoo-dev/odoo
$ ./odoo-bin -d demo --addons-path="../todo_app,./addons"

If you look closer at the server log, you will notice a line reporting the addons path in use: INFO? odoo: addons paths: [...]. Confirm that it contains our todo_app directory.

Updating the apps list

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

For this, we need developer mode enabled, since it provides the Update Apps List menu option. It can be found in the Apps top menu.

After updating the modules list, we can confirm the new modules are available for installation. Use the Apps menu option to see the list of local modules. Search for todo and you should see the new modules made available.

Note that the second App Store menu option displays the module list from Odoo apps store instead of your local modules: