Is there some way that I can check if certain module is installed from the __init__.py
file (for example if I want to conditionally import one of my .py files depending on whether a specific module is installed, without having to set it as a mandatory dependency in my __openerp__.py
).
I see I have no cr cursor to somehow browse it from database, nor do I have the dbname to be able to instantiate my own cursor. I was hoping I could do something like
import openerp.modules as addons
loaded_mods = addons.module.loaded
if 'addon_x' in loaded_mods:
import addon_x_inheritage
but loaded returns an empty list [].
Is there any workable way to achieve this?
Odoo Module Structure: https://goo.gl/cPZ6gM