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.
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.