Skip to content

Instantly share code, notes, and snippets.

@florentx
Last active December 15, 2015 16:39
Show Gist options
  • Save florentx/5290803 to your computer and use it in GitHub Desktop.
Save florentx/5290803 to your computer and use it in GitHub Desktop.

Bootstrap OpenERP 6.1 or 7.0

This repository contains a zc.buildout bundle to install and configure OpenERP and some related tools on Debian or Ubuntu. This is tested on Debian Squeeze.

Features:

  • install and configure OpenERP 6.1 or 7.0 (using anybox.recipe.openerp)
  • install and configure supervisor
  • install and configure ERPpeek
  • download and install wkhtmltopdf binary for the report_webkit addon
  • install testing tools unittest2, mock and behave (for Behavior-driven development)
  • enhance Behave and provide nose.tools helpers (see features/README.rst)
  • provide sample BDD Features with generic Gherkin sentences and Mocks

And all these tools are ready to use.

Fork me on Github

Installation

  • Clone the repository:

    $ git clone git://github.com/florentx/openobject-mirliton.git oo-mirliton
    $ cd oo-mirliton
    $ git checkout anybox70
    

    Hint:

    switch to anybox61 branch if you need the previous version. The third branch buildout is also configured for OpenERP 6.1, but it does not use the anybox.recipe.openerp recipe.

  • Follow the instructions in the README.rst at the root of the repository

Quickstart

Run the BDD tests (it deletes and re-create the behave database):

$ bin/behave

Start OpenERP in interactive mode:

$ bin/supervisorctl shutdown
$ bin/start_openerp

Start and monitor the daemon:

$ bin/supervisord

$ bin/supervisorctl status
$ bin/supervisorctl help

Connect to a running instance of OpenERP:

$ bin/erppeek --list
$ bin/erppeek --env behave

Create your own database

The default configuration only creates the behave database for the tests. When you start to explore, you might want to create your own database.

Connect to OpenERP and create the database:

$ bin/supervisorctl shutdown
$ bin/erppeek --env +openerp
>>> client.create_database('admin', 'demo_db', demo=True)
^D

Update the configuration in buildout.cfg:

  • change options.db_name to demo_db
  • change options.admin_passwd with a secret password (optional)

Re-run bin/buildout

Now you can connect to the new database with:

$ bin/erppeek --env openerp

Or (if the server is off):

$ bin/erppeek --env +openerp

Tips and tricks

  • Read features/README.rst to start Behavior-driven development (BDD).

  • To upgrade all the dependencies to newer versions, comment the line etc/buildout-pinned.cfg with a semi-colon in buildout.cfg, then re-run bin/buildout (not recommended for Production).

  • Edit the etc/erppeek.ini.in file to connect to remote instances of OpenERP, then re-run bin/buildout to regenerate erppeek.ini.

  • Connect to local OpenERP without running the server (add a + before the name):

    $ bin/erppeek --env +behave
    

Fork me on Github

Note: the Behave integration is re-used in the OpenERP Scenario project. Don't miss it.

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment