Phong Vy
Phong Vy

Reputation: 401

How to check if a module is installed or a model is existed in odoo

I want to inherit a form from another custom module without depends but It need to be check if that module is installed or model is existed before inherit it. I researched many docs but not found any solution regards so pls help me how can I do this

Upvotes: 6

Views: 5111

Answers (3)

jackjack82
jackjack82

Reputation: 61

Check whether the module has been installed, and is in an installed state by querying against ir.module.module:

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

if not bokeh or bokeh.state != 'installed': 
    raise UserError(_('...'))

Upvotes: 6

Dayana
Dayana

Reputation: 1548

You can know if a module is installed checking the state field in the ir_module_module table.

I hope this help you!

Upvotes: 10

Heroic
Heroic

Reputation: 980

To check module installed in odoo or not follow below step :

Login with Administrator access user > Click on Apps Menu from the Top Bar > You can search module with name or Apply Filter Installed

enter image description here

Upvotes: 0

Related Questions