The auto-reload and --dev options
In the previous chapters, we saw how to add a model, fields, and views. Whenever we make changes to Python files, we need to restart the server to apply those changes. If we make changes in XML files, we need to restart the server and update the module to reflect those changes in the user interface. If you are developing a large application, this can be time-consuming and frustrating. Odoo provides a command-line option, --dev
, to overcome these issues. The --dev
option has several possible values, and, in this recipe, we will see each of them.
Getting ready
Install inotify
in your developer environment with the following command in the shell. Without inotify
, the auto-reload feature will not work:
$ pip3 install inotify
How to do it...
To enable the dev
option, you need to use --dev=value
from the command line. Possible values for this option are all
, reload
, pudb|wdb|ipdb|pdb
, qweb
, werkzeug
, and xml
. Take a look at the following...