5

Description

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

If the --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 requires pyinotify. It is a Python module for monitoring filesystems changes.

Previous Problem

I got the error:

ERROR ? pyinotify: add_watch: cannot watch /home/user/.local/share/Odoo/addons/8.0 WD=-1, Errno=No space left on device (ENOSPC)

But I followed the advice of this link and now I don't get that error anymore:

sysctl -n -w fs.inotify.max_user_watches=16384

After this I got this in the server log:

openerp.service.server: Watching addons folder /opt/odoo_8/src/linked-addons
openerp.service.server: AutoReload watcher running

That means that's working properly. And in fact I tested it with a physical addon path and it worked.

Current Problem

I have all my modules en several folders but I only use one addons path: /opt/odoo_8/src/linked-addons. This folder contains all the links of the modules that I'm using. All modules are working well when I run Odoo.

But the problem is that pyinotify is not able to check the files beyond the links and it doesn't reload the files well. What I should do to fix this? Is there a way that pyinotify can recognise the content of the links?

PD: I don't want to change my way of managing the modules folders in Odoo.

ChesuCR
  • 9,352
  • 5
  • 51
  • 114
  • 1
    Might be worth looking at watchdog https://pypi.python.org/pypi/watchdog – Padraic Cunningham Nov 09 '15 at 21:37
  • Thanks! But I prefer to use pyinotify because I can use it with the odoo launcher – ChesuCR Nov 10 '15 at 10:02
  • 1
    There is a module(http://bazaar.launchpad.net/~zaber/openobject-addons/zaber-custom/files/head:/module_reload/) that adds a button `Reload` to openerp next upgrade button. – Kenly Nov 11 '15 at 14:54

1 Answers1

2

The only solution I found is to isolate the custom modules in a different folder. I have added the new folder to the addons path in the configuration file and now everything works fine

addons_path = /opt/odoo_8/src/linked-addons,/opt/odoo_8/src/custom

PD: I saved the module folders directly in the custom folder instead of saving the links to the folders.

ChesuCR
  • 9,352
  • 5
  • 51
  • 114