Odoo Help

Welcome!

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

2

How to uninstall / upgrade a module when web page is not accessible

By
Kibong Moon
on 1/14/15, 9:13 PM 4,139 views

I installed a custom module which turned out to have error in xml file. I stopped server and fixed the error. But I cannot access any page after server restart.

It seems that the server still has the problematic module. I need to upgrade the module first. But I cannot access upgrade menu.

Is there a way to upgrade or uninstall a module outside the web?

Regards,

Kibong

3

Stephen Mack

--Stephen Mack--
5023
| 8 8 9
Santiago, Chile
--Stephen Mack--

Some people call me a karma whore, I only ask for 10 points if you like my answer and 15 if I happen to get it correct.

Stephen Mack
On 1/14/15, 9:35 PM

You can update a module using the command line.

Upgrade would be: odoo.py -d <database> -u <module> -c <config file>

There is no command line option to delete a module

For uninstall module via terminal you can always do: psql - database -c "update ir_module_module set state='uninstalled' where name='module' ;" ... true not realy using orm but that is commandline way to quickly "uninstall" module.. it will not remove any data, just mark the module uninstalled...

Bole
on 1/15/15, 2:51 AM
2

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 1/15/15, 12:58 AM

This is not supposed to be the "proper" way, but this is what I use if the database I am using for developement has been foobared.  Use psql (or PgAdmin III) to access the database, open the ir_module_module table, then change the value of the state field of the module you want to change.  The values are: 'uninstalled', 'to install', 'installed', 'to upgrade', 'to remove'.

You must be very careful so that it does not make the database more foobared:

  • never make modules that are 'uninstalled' to be 'installed' or 'to upgrade'.  Always make it 'to install' so that it is installed properly during the next refresh.
  • never make 'installed' module to be 'uninstalled'.  Always try to go through 'to remove' state first so that it is uninstalled properly
  • never delete any record.  Do it from the UI once it is up.
0
Dale
On 7/14/15, 8:38 AM

Thanks for the above advice


I have tried the command above but I get the error CRITICAL <database> openerp.service.server: Failed to initialize the database. What else can I try?


Below is the error:



odoo@ubuntu:~/addons/website_report$ /opt/odoo/odoo.py -d MMC_Live -u website_report -c /etc/odoo-server.conf

ERROR: couldn't create the logfile directory. Logging to the standard output.

2015-07-14 12:39:49,424 1995 INFO ? openerp: OpenERP version 8.0

2015-07-14 12:39:49,425 1995 INFO ? openerp: addons paths: ['/opt/odoo/.local/share/Odoo/addons/8.0', u'/opt/odoo/addons', '/opt/odoo/openerp/addons']

2015-07-14 12:39:49,425 1995 INFO ? openerp: database hostname: localhost

2015-07-14 12:39:49,425 1995 INFO ? openerp: database port: 5432

2015-07-14 12:39:49,425 1995 INFO ? openerp: database user: odoo

2015-07-14 12:39:49,641 1995 INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069

2015-07-14 12:39:49,663 1995 INFO MMC_Live openerp.modules.loading: loading 1 modules...

2015-07-14 12:39:49,902 1995 INFO MMC_Live openerp.modules.loading: 1 modules loaded in 0.24s, 0 queries

2015-07-14 12:39:52,791 1995 CRITICAL MMC_Live openerp.service.server: Failed to initialize database `MMC_Live`.

Traceback (most recent call last):

File "/opt/odoo/openerp/service/server.py", line 909, in preload_registries

registry = RegistryManager.new(dbname, update_module=update_module)

File "/opt/odoo/openerp/modules/registry.py", line 366, in new

openerp.modules.load_modules(registry._db, force_demo, status, update_module)

File "/opt/odoo/openerp/modules/loading.py", line 326, in load_modules

modobj.button_upgrade(cr, SUPERUSER_ID, ids)

File "/opt/odoo/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/opt/odoo/openerp/addons/base/module/module.py", line 542, in button_upgrade

self.update_list(cr, uid)

File "/opt/odoo/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/opt/odoo/openerp/addons/base/module/module.py", line 654, in update_list

handler.load_addons()

File "/opt/odoo/openerp/http.py", line 1298, in load_addons

m = __import__('openerp.addons.' + module)

File "/opt/odoo/openerp/modules/module.py", line 80, in load_module

mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)

File "/opt/odoo/.local/share/Odoo/addons/8.0/auto_backup/__init__.py", line 23, in <module>

import backup_scheduler

File "/opt/odoo/.local/share/Odoo/addons/8.0/auto_backup/backup_scheduler.py", line 33, in <module>

raise ImportError('This module needs pysftp to automaticly write backups to the FTP through SFTP. Please install pysftp on your system. (sudo pip install pysftp)')

ImportError: This module needs pysftp to automaticly write backups to the FTP through SFTP. Please install pysftp on your system. (sudo pip install pysftp)

^C2015-07-14 12:40:01,877 1995 INFO MMC_Live openerp.service.server: Initiating shutdown

2015-07-14 12:40:01,877 1995 INFO MMC_Live openerp.service.server: Hit CTRL-C again or send a second signal to force the shutdown.

0
Kibong Moon
On 1/14/15, 11:22 PM

Dear Stephen & Ivan,

Thank you!

Pardon me that I couldn't leave comment right below your answers due to shortage of karma.

Regards,

Kibong

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/14/15, 9:13 PM
Seen: 4139 times
Last updated: 7/14/15, 8:43 AM