Skip to main content

Make your Odoo scripts sing.

Project description

https://travis-ci.org/camptocamp/anthem.svg?branch=master

Anthem is a tool to help scripting Odoo instances for automated setup, upgrades, testing and more.

It should be an alternative to the other tools like oerpscenario.

Make your own songs

Writing your songs is as easy as creating a Python Package. The songs functions called by anthem must have a positional ctx argument.

## songs/install.py

def setup_company(ctx):
    """ Setup company """
    company = ctx.env.ref('base.main_company')
    company.name = 'My Company'


def main(ctx):
    setup_company(ctx)

Execute your songs

Use the command line anthem. Provided your songs and openerp are in the PYTHONPATH:

anthem songs.install::main -c path/to/openerp.cfg

Anthem will execute the function main of the module songs.install with a ctx initialized with an Odoo env.

Instead of using -c for the command line, you can export the environment variable OPENERP_SERVER with the path of the configuration file.

export OPENERP_SERVER=path/to/openerp.cfg
anthem songs.install::main

In order to have openerp in the PYTHONPATH, you might install it as a package with pip install -e or directly modify the PYTHONPATH.

In order to have your songs in the PYTHONPATH, the better is to make a Python package out of them.

Run the tests

To run anthem’s tests, it is a good idea to to an editable install of it in a virtualenv, and then intall and run pytest as follows:

% git clone https://github.com/camptocamp/anthem.git
Cloning into 'anthem'...
% cd anthem
% python2 -m virtualenv env
% source env/bin/activate
% pip install -e .
% pip install pytest
% py.test

Release History

0.1.3 (2016-07-07)

Fixes

  • Correct lyric to create or update a record

0.1.2 (2016-07-07)

  • Add a lyric to create a xmlid

  • Add a lyric to create or update a record

0.1.1 (2016-06-23)

  • Fixed crash on non-editable install.

0.1.0 (2016-06-23)

Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anthem-0.1.3.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

anthem-0.1.3-py2-none-any.whl (8.0 kB view details)

Uploaded Python 2

File details

Details for the file anthem-0.1.3.tar.gz.

File metadata

  • Download URL: anthem-0.1.3.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for anthem-0.1.3.tar.gz
Algorithm Hash digest
SHA256 2b8184b779587b2aae49287675b3bfeed464111fc4886682f0451831109d14ce
MD5 1fc1fea3b917a06e26f8454a0aee9441
BLAKE2b-256 4118b18a08504b13c1c35365bfa165a3b128612bc2c2dc6cbc3669ce7b63b1fb

See more details on using hashes here.

File details

Details for the file anthem-0.1.3-py2-none-any.whl.

File metadata

File hashes

Hashes for anthem-0.1.3-py2-none-any.whl
Algorithm Hash digest
SHA256 a677d77cf46afc052b4649b7f78e06e61154143f9e72e4d906c0dbd184a8a263
MD5 7767bb79c41ae739e41b878a38159b27
BLAKE2b-256 87c02f1160a21b983e7bd60767df5506f09b5c1254a4cf35fef5816bbbc39b49

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page