5

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

Phong Vy
  • 369
  • 5
  • 19

3 Answers3

10

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

I hope this help you!

Dayana
  • 1,500
  • 1
  • 16
  • 29
5

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(_('...'))
snakecharmerb
  • 47,570
  • 11
  • 100
  • 153
jackjack82
  • 51
  • 1
  • 1
  • The code checks whether a module in odoo has been installed by searching the module name and checking the state which is either installed or uninstalled – herbert ichama Aug 07 '20 at 05:36
0

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

Heroic
  • 980
  • 4
  • 12