Skip to main content

Simple wrapper for running headless Odoo scripts

Project description

Odoo Runner

Small wrapper for running headless Odoo scripts.

Install

pip install odoo-runner

Example

test.py:

#! /usr/bin/env python

import sys
from odoo_runner import OdooRunner


def start(env):
    return env['res.partner'].search_count([])


if __name__ == "__main__":
    args = sys.argv[1:]
    runner = OdooRunner(args, start)
    partner_count = runner.run()
    print("Number of partners:", partner_count)

    sys.exit(0)

running:

PYTHONPATH=/path/to/odoo/src/ ./test.py -c /path/to/odoo.conf --logfile=''

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

odoo-runner-0.0.3.tar.gz (38.4 kB view hashes)

Uploaded Source

Built Distribution

odoo_runner-0.0.3-py3-none-any.whl (27.0 kB view hashes)

Uploaded Python 3

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