Odoo Help


Is there a proper way to "upgrade" custom module in Windows?

Abdullah Sofan
on 12/22/14, 2:38 AM 2,017 views

I am developing a custom module for Odoo in WIndows. Everything is working fine, but I find that the way to make changes to my code a bit tedious and I thought I would ask the experts here to help me make it faster.

Currently, everytime I make modification to my code, I do the following steps to test the outcome:

1) In Odoo, I go to Settings>Local Modules> My App and click "Uninstall

2) In Windows, I remove the modules folder from the "addons" directory and replace it with the new modified version.

3) I go to Windows> Control Panel> Administrative Tools > Services and I restart both the "PostgreSQL_for Odoo" service as well as the "Odoo-server" service

4) In Odoo, I click on Settings> Update Modules List

5) I then go to Settings> Local Modules> My App and click "Install"

As you can see, this is a lengthy process, but this is the only way I found that works. It gets to be frustrating when the change in code is only an indentation or a forgotton comma :-)

If I just click to "Upgrade" my module, I usually get various errors like "Internal Server Error" or "getitem" key errors. Also, if I don't restart both services above, odoo does not load the changes in the python code.

So, is there a "proper way" to upgrade a module or even modify the code directly while Odoo is running?

thanks in advance



| 5 3 6
Jakarta, Indonesia
On 12/22/14, 5:29 AM

@Abdullah, you shouldn't Uninstall modules for upgrade.  It may removed existing data.  What you should do is

  1. Update the module that you want to upgrade in the addons folder
  2. Restart the Odoo-server service (unfortunately this is still necessary as python need to create the compiled version of the py files).
  3. If you have new modules, click the Setting >> Modules >> Update Module List menu and follow through
  4. Then from Setting >> Modules >> Installed Modules, select the modules you just updated, and click on Upgrade button.

Note that 2 is required if you change any of the py files.  If you don't change py files, you can skip it.  Yes, some error may occurs if you radically change the structure of model in the update module.  Hence, it is better not to remove any existing fields or change their type.

Note on 4: if you don't change any data files (XML or CSV) included in the module and you don't change any model structure (no fields or defaults or sql_constraint or constraint [etc....] added/removed/modified) and only change method implementation, you may get away without doing 4.

Additional Note: if you define a data record in the old version of the module and you don't require it anymore int he new version of the module, add a <delete model="model_id" id="xml_id_of_record_to_delete"/> into the XML file to properly remove the data.

Hi Ivan. Thank you for your help. When I install my app I don't face a problem. But when I do "upgrade" as per your instructions I get this error:
File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\modules\registry.py", line 101, in __getitem__ ParseError: "report.paperformat" while parsing file:///C:/Program Files (x86)/Odoo 8.0-20141221/server/openerp/addons/academy/academy_view.xml:1209, near European A4 low margin A4 0 0 Portrait 5 5 5 5 0 80

Abdullah Sofan
on 12/22/14, 8:11 AM

I think it may have something to do with the imports or dependency of the academy module. Check the __openerp__.py file in the academy module and see if module "report" is listed as dependency.

on 12/23/14, 12:18 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 12/22/14, 2:38 AM
Seen: 2017 times
Last updated: 3/16/15, 8:10 AM