Upgrading a module
Developing a module is an iterative process, and you will want changes made on source files to be applied to and made visible in Odoo.
In many cases, this is done by upgrading the module: look up the module in the Apps list and once it is already installed, you will have 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. Since Odoo loads Python code only once, any later changes to code require a server restart to be applied.
In some cases, if the module changes were in both data files and Python code, you might need both the operations. This is a common source of confusion for new Odoo developers.
But fortunately, there is a better way. The safest way to make all our changes to a module effective is to stop and restart the server instance, requesting our modules to be upgraded to our work database.
In the terminal where the server instance is running, use Ctrl + C to stop it. Then, start the server and upgrade the todo_app module using the following command:
$ ./odoo-bin -d todo -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. When a module is updated, all other installed modules depending on it are also updated. This is essential to maintain the integrity of the inheritance mechanisms, used to extend features.
Throughout the book, when you need to apply the work done in modules, the safest way is to restart the Odoo instance with the preceding command. Pressing the up arrow key brings to you the previous command that was used. So, most of the time, you will find yourself using the Ctrl + C, up, and Enter key combination.
Similarly, a -i option, or --install, is also available to perform the installation (or reinstallation) of modules. For new modules, you had to update the module list in the web client before they could be installed, but since Odoo 11 this has not been necessary and new modules can immediately be installed.