Giter Club home page Giter Club logo

odoo2dev's Introduction

odoo2dev

License: AGPL-3

Python support

Odoo

odoo2dev is a python3/2 package providing facilities to use a dump of your production database in your dev environment. It builds on top of click-odoo.

The motivations for this library is to handle redundant operations in a simple and convenient way.

Features

The following operations are executed:

Always:
  • deactivate crons and outgoing mails

Other operations are optionnal and depends of options or environment vars:

Optionally and depending on the inputs:
  • ODEV_INSTALL: comma-separated list of modules to install
  • ODEV_UNINSTALL: comma-separated list of modules to uninstall
  • ODEV_RESET_PASSWORD: boolean flag to reset password to default 'admin'
  • ODEV_LOGO_PATH: path to the logo (favicon) that should be used
  • execute provided script with [SCRIPT] [SCRIPT_ARGS] or ODEV_SCRIPT env vars

Install

Install this lib in your project with

pip install git+https://github.com/akretion/odoo2dev.git@master#egg=odoo2dev

odoo2dev relies on the excellent click-odoo

Usage

  • You may define a script to executed as last step
pg_restore -d my_db my.dump ; odev my-script -d my_db ; odoo

Recurrent inputs can be preferably be used with environment variables like below

  • Set environment variables, for example on your docker-compose file, with key-value pairs:
- ODEV_SCRIPT=/odoo/my-script
# in combination with https://github.com/camptocamp/anthem
- ODEV_SCRIPT=anthem songs.my-script::main
- ODEV_INSTALL=web_environment_ribbon,my_other_module
- ODEV_UNINSTALL=module_for_prod_only,my_useless_module
- ODEV_RESET_PASSWORD=True
- ODEV_LOGO_PATH=/my_own_path
  • Execute odoo2dev through odev command when needed, typically after database restore, i.e.:
pg_restore -d my_db my.dump ; odev -d my_db ; odoo

Here is a result example

output example
Command-line options:
-c, --config FILE
 Specify the Odoo configuration file. Other ways to provide it are with the ODOO_RC or OPENERP_SERVER environment variables, or ~/.odoorc (Odoo >= 10) or ~/.openerp_serverrc.
-d, --database TEXT
 Specify the database name. If present, this parameter takes precedence over the database provided in the Odoo configuration file.
--log-level TEXT
 Specify the logging level. Accepted values depend on the Odoo version, and include debug, info, warn, error. [default: warn]
--logfile FILE Specify the log file.
--help Show this message and exit.

Roadmap / Limitations

  • odoo2dev doesn't ensure than modules to install or uninstall are available on addons path before launch the command.
  • if required base tables are not available in called database (ir_mail_server, res_users, etc) errors can be triggered (example with a not odoo db).
  • other versions than even ones could works but not tested until now

Credits

Author:

Contributors:

Maintainer

Akretion

odoo2dev's People

Contributors

bealdav avatar kevinkhao avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

odoo2dev's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.