Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How upgrading of a Odoo module works?

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?
like image 423
Sankalp Kataria Avatar asked Mar 08 '23 22:03

Sankalp Kataria


2 Answers

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

like image 70
Shan Abdiel Avatar answered Mar 10 '23 14:03

Shan Abdiel


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

like image 30
Karara Mohamed Avatar answered Mar 10 '23 14:03

Karara Mohamed