简体   繁体   中英

How to automatically reinstall module in Odoo

I have a setup Odoo on our local system

In Odoo 11 whenever I customized or made changes in module then I have to Reinstall the app.

Is there any other way by which I do not have to reinstall every time?

After every change of the source code (Python code), you have to restart the Odoo service.

Changes in XML/JS/CSS files won't require a service restart, but the module has to be reinstalled.

To make this auto install every time you run the Odoo service, do as the following:

  1. Create in your Module dir, a file <module_dir>/data/<module_name>_updater.xml

     <odoo> <data> <function model="ir.module.module" name="update_list"/> </data> </odoo>
  2. Add this file to your __manifest__.py file.

     'data': [ ..., 'data/<module_name>_updater.xml', ... ],
  3. Run your Odoo service with

    If you run your service by the executable python file

    /bin/odoo -u <module_name>

    If you run your service with service odoo start , then add this line to your odoo.conf file

    [options] update = <module_name>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM