Make your Odoo scripts sing.
Project description
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.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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file anthem-0.1.2.tar.gz
.
File metadata
- Download URL: anthem-0.1.2.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54c45b50d4cb9daf8e9030c93ba28c4d633752e5e8811a1e72cac43ccf560815 |
|
MD5 | fd582779685c54cb6844fbe3f347b098 |
|
BLAKE2b-256 | 7a3b77340dd74b7809704834e9de47e66250cd544b8dc30ee6579098164ff477 |
File details
Details for the file anthem-0.1.2-py2-none-any.whl
.
File metadata
- Download URL: anthem-0.1.2-py2-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 748800e48bd77e951ba1f89b140e4caf8147d0cc91908012c52fe101fe68f86d |
|
MD5 | a90148c6756a9f95f7fd43d9ac7cb50b |
|
BLAKE2b-256 | 2065a52999cefa85834fab0318d484776ef085ad3074c7b4dc0931c443514444 |