Menu Close
    Start a Project Request quote Reading list Switch to dark mode
    odoo-hyperlocal-marketplace-guide

    Install Module Programmatically in Odoo

    If you want to install Odoo modules without using user interface or via terminal then this blog will help you to install module programmatically.

    There have multiple ways to install module in Odoo. You can install module via commands or programmatically as well. Programmatically you can install module using below ways.

    • Install module during database creation.
    • Install module by clicking on button or any action.

    Install module on database creation

    In order to install module during database creation simply add below tag in “__manifest__.py” file or if Odoo version older than 10.0 then add below tag inside “__openerp__.py“.


    Make this tag “true” in order to install module during database creation.

    Install module by clicking on button or any action

    In order to install module during any action or button click use below code.


    Above code will help to install module programmatically.

    • update_list(): This method helps to update module list reason why this method should use before installation because if any new module is placed on server then without running this method that module will not come on module list.
    • moduleIds: In this line we check module is currently installed or not.
    • button_immediate_install(): This method helps to install module of given id.

     

    . . .

    Comments (2)

    Add Your Comment

  • Bojan Nišević
    Thanks for the info. But only thing missing here is for the second part where irModuleObj can be used? In which class? “self” will not work like that everywhere?
    • Ashish Singh
      Hi, Bojan

      Here “irModuleObj” contains the instance of “ir.module.module”.
      irModuleObj = self.env[‘ir.module.module’]

      Thanks,
      Webkul Team

  • Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again
    Close

    Table of Content

    Hide Index