allenguarnes.com

posts/2021-11-25 — less +F

Odoo: How To Uninstall Module From Terminal

November 25th, 2021 #Odoo

Similar to installing modules from the terminal, there are times when you need to bypass Odoo's front-end to directly uninstall modules.

To uninstall a module from the terminal, you need to run odoo-bin manually in shell mode. Refer to the following format:

bashodoo-bin
./odoo-bin shell -c <config file> -d <database name>

Assuming my config file is at /etc/odoo/odoo.conf and my database name is awesome_database, I would need to run odoo-bin as follows:

bashodoo-bin
./odoo-bin shell -c /etc/odoo/odoo.conf -d awesome_database

This outputs a python console where you need to run the following code (assuming my module name is awesome_module):

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