Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

How to uninstall a module from command line

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
uninstall
12 Risposte
171582 Visualizzazioni
Avatar
xpareto

How to uninstall a module from command line

22
Avatar
Abbandona
Avatar
Muhammad Awais
Risposta migliore

Run this command in your shell

python3 odoo-bin shell -d mydb --addons-path=/your/addons/path

Then run this Python script

self.env['ir.module.module'].search([('name', '=', 'crm')]).button_immediate_uninstall()


37
Avatar
Abbandona
Gary Walters

This is the Best Answer! THANKS

Aqeeb Imtiaz Harun

Thank you so much!!!

Haresh Kansara

fantastic idea. Thanks

ANDRES PENAGOS

I am having troubles .. it did not work out at V14

odoo@odoo14:~$ sudo python3 /opt/odoo/odoo-bin shell -d nominatest --addons-path /opt/odoo/addons
Traceback (most recent call last):
File "/opt/odoo/odoo-bin", line 5, in <module>
__import__('pkg_resources').declare_namespace('odoo.addons')
File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2270, in declare_namespace
path = sys.modules[parent].__path__
KeyError: 'odoo'

Cheikh Diop

working

Tri Nanda

Working on Odoo14, but doesnt forgot to restart your server if facing a new error.

Cheikh Diop

well

Ashish

Muhammad - you are a techno-magic man.. you found that solution.. awesome.. super awesome.. It works ..

Omar Alejandro Linares Escobar

When I try this solution, it display the following error:

Traceback (most recent call last):
File "/opt/odoo17/odoo/./odoo-bin", line 5, in <module>
import odoo
File "/opt/odoo17/odoo/odoo/__init__.py", line 125, in <module>
from . import modules
File "/opt/odoo17/odoo/odoo/modules/__init__.py", line 8, in <module>
from . import db, graph, loading, migration, module, registry, neutralize
File "/opt/odoo17/odoo/odoo/modules/graph.py", line 11, in <module>
import odoo.tools as tools
File "/opt/odoo17/odoo/odoo/tools/__init__.py", line 7, in <module>
from . import pdf
File "/opt/odoo17/odoo/odoo/tools/pdf.py", line 10, in <module>
import PIL
ModuleNotFoundError: No module named 'PIL'

Please, help :(

Avatar
Devendra Kavthekar
Risposta migliore

My stackoverflow answer:

http://stackoverflow.com/questions/21485630/how-to-uninstall-manually-openerp-module/41760541#41760541


There are two ways
    1.Apply the Patch of my pull request:
            https://github.com/odoo/odoo/pull/12373.patch (git apply /home/user/patch_file.patch)
    2.Manually:

  • Go to Terminal > psql db and Execute the query like: update ir_module_module set state='to remove' where name='module_name' and state='installed';

  • Add update_module=True in loading.py before this line > https://github.com/odoo/odoo/blob/10.0/odoo/modules/loading.py#L378

And run the odoo.py or odoo-bin.
This will uninstall the module properly and safely.

Let me know if face any problem.

7
Avatar
Abbandona
Avatar
NUMERIGRAPHE
Risposta migliore

You can uninstall a module using the XML-RPC API.

Here is the script I use for v7 (it probably works in later version too).

#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Uninstall a module"""

import xmlrpclib
import argparse
import getpass

parser = argparse.ArgumentParser()
# Connection args
parser.add_argument('-d', '--database', help="Use DB as the database name",
                    action='store', metavar='DB', default=getpass.getuser())
parser.add_argument('-u', '--user', help="Use USER as the database user name",
                    action='store', metavar='USER', default='admin')
parser.add_argument('-w', '--password',
                    help="Use PASSWORD as the database password.",
                    action='store', metavar='PASSWORD', default='admin')
parser.add_argument('-s', '--url',
                    help="Point to the web services hosted at URL",
                    action='store', metavar='URL',
                    default='http://localhost:8069')
# Feature args
parser.add_argument('module', help="Uninstall the module MODULE",
                    action='store', metavar='MODULE')

args = vars(parser.parse_args())

# Log in
ws_common = xmlrpclib.ServerProxy(args['url'] + '/xmlrpc/common')
uid = ws_common.login(args['database'], args['user'], args['password'])
print "Logged in to the common web service."
# Get the object proxy
ws_object = xmlrpclib.ServerProxy(args['url'] + '/xmlrpc/object')
print "Connected to the object web service."

# Find the parent location by name
res_ids = ws_object.execute(
    args['database'], uid, args['password'],
    'ir.module.module', 'search', [('name', '=', args['module'])])
if len(res_ids) != 1:
    raise Exception("Search failed")

# Uninstall the module
print "Uninstalling '%s'" % args['module']
ws_object.execute(
    args['database'], uid, args['password'],
    'ir.module.module', "button_immediate_uninstall", res_ids)

print "All done."

5
Avatar
Abbandona
Avatar
Justin
Risposta migliore

It should be possible to uninstall modules programmatically, because then you can script it for automation.

Having to manually log in to a system to perform administrative functions is error prone and tedious for repetitive tasks. In 2014, every GUI operation should have an API command that does the same thing.

I'm scripting an upgrade path for my 6.1 version database and this is making my testing more difficult than it needs to be.

5
Avatar
Abbandona
Justin

I found a way to do it. Set the state column in ir_module_module for the module to 'to remove' similar to this: psql -c "UPDATE ir_module_module SET state = 'to remove' WHERE name = '';" and then perform a commandline update: openerp-server -u The update will trigger the module removal.

Royal Administrator

Gratitude. Solved it for me with Odoo 9, given I inserted this patch as step 2A in openerp/modules/loading.py, and then commented the corresponding two lines of code at the top of STEP 5. Of course, be careful everybody.... # 13.0.3.3.11-t11 jrook STEP 2A: Before step 3, setup list of modules to remove later during step 5. # since 'to remove' modules will be loaded during step 3 and will exit step 3 in 'installed' state. cr.execute("SELECT name, id FROM ir_module_module WHERE state=%s", ('to remove',)) modules_to_remove = dict(cr.fetchall())

Royal Administrator

Try for better indent this time... # 13.0.3.3.11-t11 jrook STEP 2A: Before step 3, setup list of modules to remove later during step 5. # since 'to remove' modules will be loaded during step 3 and will exit step 3 in 'installed' state. cr.execute("SELECT name, id FROM ir_module_module WHERE state=%s", ('to remove',)) modules_to_remove = dict(cr.fetchall())

Ermin Trevisan

Whoever did it, I do not see a reason to flag this post, so please explain or leave it as is.

CARLOS ALBERTO GARCIA BRIZUELA

Really great your solution Justin, thanks!

Avatar
Ajmal C
Risposta migliore
  • python3.10 ./odoo-bin shell -c xyz.conf -d test_db

  • Search module by using bellow script self.env['ir.module.module'].search([('name','=','module_name')])  then you get the result like "ir.module.module(1060,)"
  • Uninstall module using button_immediate_uninstall() function 

self.env['ir.module.module'].search([('name','=','module_name')]).button_immediate_uninstall()

0
Avatar
Abbandona
Avatar
Dharmesh Chudasama
Risposta migliore

I try in odoo14, To Uninstall Any Module From Terminal - Please Follow those steps:

sudo su postgres

psql db_name

update ir_module_module set state='uninstallable' where name='module_name' and state='installed';


That's it.....Thank you....!!!

0
Avatar
Abbandona
Bert Stomphorst

Great, thank you for sharing this simple way. This helped me a lot.

Avatar
Gavin Yap
Risposta migliore

You can now do it using odoorpc library.

I've did an example of installation here

https://github.com/maclarensg/odoo_module_install_script,

You probably can modify it to uninstall. 

0
Avatar
Abbandona
Avatar
Devendra Kavthekar
Risposta migliore

You can use the patch of the Pull request for your own odoo:

https://github.com/odoo/odoo/pull/12373


Odoo sees this as opening a loophole/vulnerability, so they don't want this feature to be available.

0
Avatar
Abbandona
ANDRES PENAGOS

DevendraK i download https://github.com/odoo/odoo/blob/10.0/odoo/modules/loading.py and apply patch directions from https://github.com/odoo/odoo/pull/12373 (april2018) . I am using " --uninstall

module_name" but it does not uninstall the module. do I still have to use

Add update_module=True in loading.py (feb 2017 comment)???

thaks a lot

Avatar
Cheikh Ahmed Tidianne
Risposta migliore

Very good 👍 ça fonctionne .vous m'avez permis de résoudre un gros problème, thanks thanks thanks

0
Avatar
Abbandona
Avatar
Pavel Pavlov
Risposta migliore

Hello,

I don't think there is a command line to do that. The only option that is supported as far as i know is the Settings -> Apps -> <the module=""> -> Uninstall. In general uninstall is not smart idea... you need to be extra careful.

Regards, Pavel Pavlov

-3
Avatar
Abbandona
Avatar
Gopakumar N G
Risposta migliore

There is no way to uninstall a module from terminal. You can check the possible options by running
./openerp-server --help in terminal.

-4
Avatar
Abbandona
Avatar
Acespritech Solutions Private Limited
Risposta migliore

Hi,

I think there is no way to uninstall module from command line but temporarily you may cut module(the module you want to uninstall) from your addons path. It is not the best way but atleast it will let you know the issue.

-5
Avatar
Abbandona
Pravin Acharya

This helped me :)

Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
Odoo 16 | Context error when uninstalling sale module
uninstall context
Avatar
Avatar
1
set 23
2439
Key error uninstalling custom module in Odoo v8
modules uninstall
Avatar
Avatar
Avatar
2
mag 21
10400
Uninstall module programatically using boolean Risolto
module uninstall
Avatar
Avatar
1
nov 19
5766
Uninstall openERP from Ubuntu Risolto
uninstall openerp
Avatar
Avatar
Avatar
2
dic 23
43503
Uninstall Module where the source code is not there anymore Risolto
module uninstall
Avatar
1
mar 16
5713
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now