When you’re developing custom module or working on Python code, Odoo server needs to be restarted on every code change.

To make your life easier auto reload Odoo server after Python code change.

Option –auto-reload monitors the source code and automatically restart Odoo server if changes are detected.

Example of usage:

./odoo.py -d test_database --auto-reload

This is a Linux-only feature.

The pyinotify Python package is required, and it should be installed either through apt-get or pip:

Using apt-get:

sudo apt-get install python-pyinotify

Using pip:

pip install pyinotify

https://github.com/seb-m/pyinotify/wiki

Warning:

If you use PyCharm or some other IDE with auto save, disable auto save before using –auto-reload option.

Happy coding…

 

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!