Menu Search Icon

ODOO: remove from database a deleted module

ODOO: remove from database a deleted module

What is Odoo?

Odoo is a comprehensive suite of open-source business applications aimed at streamlining various aspects of business operations. Developed using Python programming language and built on a modular architecture, Odoo offers a wide range of customizable modules covering functionalities such as accounting, sales, CRM, inventory management, human resources, and more. It provides businesses with a flexible and scalable solution to manage their day-to-day activities efficiently.

The Need to Remove Modules Without the Removal Panel, But from the Base

In certain scenarios, there may arise a need to remove modules from the Odoo platform directly from the base without relying on the removal panel. This could be due to various reasons such as optimizing system resources, decluttering the interface, or ensuring compliance with specific business requirements.

Removing modules directly from the base involves accessing the underlying database of the Odoo instance and manipulating the module records. However, it's essential to exercise caution while performing such operations to avoid any unintended consequences or data inconsistencies.

Before proceeding with module removal from the base, it's advisable to create a backup of the database to safeguard against data loss. Additionally, thorough testing should be conducted in a staging environment to ensure the stability and integrity of the Odoo instance post-removal.

While removing modules from the base can help streamline the Odoo setup and enhance system performance, it should be done judiciously, keeping in mind the potential impact on other interconnected modules and functionalities.

How to remove module?

Read the id of your module from ir_module_module


SELECT id
FROM ir_module_module
WHERE name=’your_module_name’;

trying to delete the module from ir_module_module directly:

DELETE FROM ir_module_module WHERE id=your_module_id;

in case of constraints error, delete the same module id from the specified tables, for example:
- error:

CONTEXT: SQL statement “UPDATE ONLY “public”.”ir_model_constraint” SET “module” = NULL WHERE $1 OPERATOR(pg_catalog.=) “module””
- solution:
DELETE FROM ir_model_constraint WHERE module=your_module_id;
- error:
CONTEXT: SQL statement “UPDATE ONLY “public”.”base_module_uninstall” SET “module_id” = NULL WHERE $1 OPERATOR(pg_catalog.=) “module_id””
- solution:
DELETE FROM base_module_uninstall WHERE module_id=your_module_id;