Upgrading a module

Developing a module is an iterative process, and you will want changes made on source files to be applied and visible in Odoo.

In most cases this is done by upgrading the module: look up the module in the Local Modules list and, since it is installed, you will see an Upgrade button available.

However, when the changes are only in Python code, the upgrade may not have an effect. Instead of a module upgrade, an application server restart is needed.

In some cases, if the module has changed both in data files and Python code, you might need both operations. This is a common source of confusion for newcomer Odoo developers.

But fortunately, there is a better way. The simplest and fastest way to make all our changes to a module effective is to stop (Ctrl + C) and restart the server process requesting our modules to be upgraded on our work database.

To start the server upgrading the todo_app module in the v8dev database, we will use:

$ ./odoo.py -d v8dev -u todo_app

The -u option (or --update in the long form) requires the -d option and accepts a comma-separated list of modules to update. For example, we could use: -u todo_app,mail.

Whenever you need to upgrade work in progress modules throughout the book, the safest way to do so is to go to the terminal window where you have Odoo running, stop the server, and restart it with the command above. Frequently pressing the Up arrow key will be enough, since it should bring you the previous command you used to start the server.

Unfortunately, updating the module list and uninstalling modules are both actions not available through the command line. These have to be done through the web interface, in the Settings menu.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset