5
  • Actually In the command of start odoo 8 server.
  • It will provide "--auto-reload" option
  • But actually i don't know how it works and when to work.
  • Please if give me some guideline for that
Virbhadrasinh
  • 529
  • 6
  • 19

2 Answers2

9

Normally if you change your python code means, you need to restart the server in order to apply the new changes.

--auto-reload parameter is enabled means, you don't need to restart the server. It enables auto-reloading of python files and xml files without having to restart the server. It required pyinotify. It is a Python module for monitoring filesystems changes.

Just add --auto-reload in your configuration file. By default the value will be "false". You don't need to pass any extra arguments. --auto-reload is enough. If everything setup and works properly you will get

openerp.service.server: Watching addons folder /opt/odoo/v8.0/addons
openerp.service.server: AutoReload watcher running

in the server log. Don't forget to install pyinotify package.

no coder
  • 2,290
  • 16
  • 18
  • after this answer i tested but its not working , what ever i change in python without restart server not applied in my module .. that --auto-reload is enable but also its not working – Virbhadrasinh Mar 25 '15 at 05:57
  • If any method to do this things , without restarting my server apply changes in module than please guide me – Virbhadrasinh Mar 25 '15 at 06:00
  • I have updated the answer. Check your log for "AutoReload watcher running" is present or not. – no coder Mar 25 '15 at 06:54
  • 1
    I installed `python-pyinotify`. I added `--auto-reload`, the server log also showed `AutoReload watcher running`, but my module wasn't automatically updated when the code was changed. Does anyone have the similar problem? – Hieu Jun 25 '15 at 07:07
  • If you are using Vagrant and any virtual machine it might take some for pynotify to see the changes and the code might not be updated instantly. – Aftab Naveed Oct 27 '15 at 03:01
3

I found this looking for the same thing, but for odoo 10. Someone will follow the same route, so:

This has been changed in odoo 10 to --dev=reload. BUT you can't specify that in /etc/init.d/odoo itself. Only from the command line.

WeeDom
  • 324
  • 3
  • 12