This question has been flagged
3 Replies
15470 Views

I have been noticing inconsistant behavior when trying to update my custom modules. I have been restarting the OpenERP server each time (/etc/init.d/openerp restart) and selecting upgrade from Settings: Installed Modules: Module Name, but some of my changes aren't going through. I have even tried installing the module on a differnt database, but it still had the original configuration. These are mostly changes to the .py file, sometimes to the .xml. Any idea what is going on here? Am I missing something? I definitely have made and seen changes like this before, I don't know what is going on here. Thanks!

Avatar
Discard
Author

Thanks Ray. The phrasing 'Upgrade' was confusing to me. Could you elaborate on the second bit - about restarting the duplicate? Is there any way to check which one you are restarting? I am still getting inconsistent update results. For example, I added one more choice to a drop down menu (just a single python line change), restarted my server via '/etc/init.d/openerp restart', and clicked 'Upgrade' on my module, but the new menu item still isn't showing up.

Best Answer

Python changes are seen by the server once rebooted, not before (this is just how Python works).  The parts that define objects (models) will not be 'applied' unless you update the module, but other changes don't require you to update the module.  BUT - the best practice is to update the module every time you make Python changes.

XML changes are seen as soon as they are saved (no restart required), but never loaded until you update the module. The best practice is to update the module every time there is a change to an XML file.

In Summary: the best practice:  Restart the server and update the module every time you change either type of file.

Also - check that you haven't started the server twice, as the restart could be restarting the duplicate, not the one you are using to update the module.

Avatar
Discard
Author

By update the module, do you mean selecting 'Update Modules List' or going to the module in question and clicking 'Upgrade'?

The second. Updating Modules List simply scans the addons folders for modules that have been copied there since the last time that command was run and adds the to the list of modules that can be installed.

Author

It definitely was the duplicate server error. I did a ps command and was able to find and kill the other openerp server. Do you have any other resources on why this happens? I couldn't find any information about it, and it had been causing lots of trouble.

Is there some code that automates this? I.e. a script that checks if files are changed and upgrades/restarts when needed?

I have created a command-line alias 'bounce' which restarts the server when needed. I think it is overkill to have a script that monitors every python file in the system (there are over 1,000). You and your developers know when you make a source code change, since you are logged into the system when you do it, so the last step is to type 'bounce' with my method.

Best Answer

changes in:

  • XML -> update module
  • Python -> restart server
  • JS,CSS -> reload webpage
Avatar
Discard
Best Answer

you may try to update via command line like "./openerp-server -u module_name -d db_name"

[EDIT] - Removed typo

Avatar
Discard

can you specify what or where this file is? "./operp-server.py"

Ah, seems I made a type. It is the file openerp-server and it is the main executable when running OpenERP under linux. It should be in the root directory of the OpenERP installation. (normally somewhere under /opt/openerp ). The linux deamon points to this file when you start it.

Author

In my (Linux) installation, it can be found at /usr/bin/