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:

./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:

./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):

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

| Odoo: How To Install Module From Terminal >