4

I have two databases in odoo DB1 and DB2. I made some changes to existing modules(say module1 and module2) in DB1 through GUI(web client). All those changes were stored to DB1 and were working correctly when I am logged in through DB1.

Now, I made some changes in few files(in same two modules module1 and module2). These modules need to be upgraded in order to load those changes. So, i logged in from DB2 and upgraded those modules. My changes in file loaded correctly and were working correctly when I am logged in through DB2.

But those file changes were loaded only for DB2 and not for DB1.

So, I wanted to know:

  1. How upgrading of a module works?? Does it upgrades only for the database through which the user is logged in and upgraded the module?
  2. And if it is so. Then, is there a way that I can Upgrade my module while retaining all the previous changes that i made through the GUI in that same module?
  3. What are the things that are changed when a module is upgraded?
Sankalp Kataria
  • 479
  • 7
  • 24

2 Answers2

4

There is 2 step for upgrading an addons in Odoo,

First, restarting the service. it will upgrade your .py files. Second, click upgrade button in Apps>youraddonsname. it will upgrade your .xml files.

i create a script for upgrading the XML files. the name is upgrade.sh

#!/bin/sh for db in $(cat /opt/odoo/scripts/yourlistdbfiles); do odoo --addons-path=/opt/odoo/youraddonspath -d $db -u youraddonsname --no-xmlrpc > /opt/odoo/logs/yourlogfiles.log 2>&1 & sleep 20s && exit & done

so you just run sh /opt/odoo/script/upgrade.sh after editing your addons and no need to click the upgrade button anymore.

hope this help

3

you can restart the server and start the server by python odoo-bin -d database_name -u module_name or -u all to update all module

Karara Mohamed
  • 923
  • 1
  • 6
  • 19
  • That only works when changes are made in python code. It does not work XML changes. For XML you have to upgrade your module. Also, restarting server will not work when changes are made in model such as adding a field or removing it. Please read the question again. – Sankalp Kataria Sep 30 '17 at 10:09