Skip to main content

Versatile tool for Odoo

Project description

Download and install the latest release:

pip install -U odooly

Documentation and tutorial: https://odooly.readthedocs.io/

Overview

Odooly connects to an Odoo instance through HTTP. It makes it easy to browse the application model, and to perform actions. It carries three modes of use:

  1. with command line arguments

  2. as an interactive shell

  3. as a client library

Key features:

  • provides an API similar to Odoo Model, through Webclient API

  • supports JSON-2 API with Odoo 19 and more recent

  • supports external APIs JSON-RPC and XML-RPC as alternative

  • compatible with Odoo 8 to 19, and OpenERP

  • single file odooly.py, no external dependency

  • helpers for search, for data model introspection, etc…

  • simplified syntax for search domain

  • entire API accessible on the Client.env environment

  • can be imported and used as a library: from odooly import Client

  • supports Python 3.6 and more recent

Interactive use

Launch without any configuration. It connects to the Odoo server, local or remote:

~$ odooly --server https://demo.odoo.com/

Or:

~$ odooly --server http://127.0.0.1:8069/

Environments can also be declared in odooly.ini:

[DEFAULT]
scheme = http
host = localhost
port = 8069
database = odoo
username = admin

[demo]
username = demo
password = demo
protocol = web

[demo_jsonrpc]
username = demo
password = demo
protocol = jsonrpc

[local]
scheme = local
options = -c /path/to/odoo-server.conf --without-demo all

Connect to the Odoo server:

~$ odooly --list
~$ odooly --env demo

This is a sample session:

>>> env['res.users']
<Model 'res.users'>
>>> env['res.users'].search_count()
4
>>> crons = env['ir.cron'].with_context(active_test=False).search([])
>>> crons.read('active name')
[{'active': True, 'id': 5, 'name': 'Calendar: Event Reminder'},
 {'active': False, 'id': 4, 'name': 'Mail: Fetchmail Service'}]
>>> #
>>> env.modules('delivery')
{'uninstalled': ['delivery', 'website_sale_delivery']}
>>> env.upgrade('base')
1 module(s) selected
42 module(s) to process:
  to upgrade    account
  to upgrade    account_chart
  to upgrade    account_tax_include
  to upgrade    base
  ...
>>> #

Command line arguments

There are few arguments to query Odoo models from the command line. Although it is quite limited:

~$ odooly --help

Usage: odooly.py [options] [search_term_or_id [search_term_or_id ...]]

Inspect data on Odoo objects.  Use interactively or query a model (-m) and
pass search terms or ids as positional parameters after the options.

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -l, --list            list sections of the configuration
  --env=ENV             read connection settings from the given section
  -c CONFIG, --config=CONFIG
                        specify alternate config file (default: 'odooly.ini')
  --server=SERVER       full URL of the server (default:
                        http://localhost:8069/web)
  -d DB, --db=DB        database
  -u USER, --user=USER  username
  -p PASSWORD, --password=PASSWORD
                        password, or it will be requested on login
  --api-key=API_KEY     API Key for JSON2 or JSON-RPC/XML-RPC

  -m MODEL, --model=MODEL
                        the type of object to find
  -f FIELDS, --fields=FIELDS
                        restrict the output to certain fields (multiple
                        allowed)
  -i, --interact        use interactively; default when no model is queried
  -v, --verbose         verbose
$ #

Example:

$ odooly -d demo -m res.partner -f name -f lang 1
"name","lang"
"Your Company","en_US"
$ odooly -d demo -m res.groups -f full_name 'id > 0'
"full_name"
"Administration / Access Rights"
"Administration / Configuration"
"Human Resources / Employee"
"Usability / Multi Companies"
"Usability / Extended View"
"Usability / Technical Features"
"Sales Management / User"
"Sales Management / Manager"
"Partner Manager"

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

odooly-2.5.2.tar.gz (68.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odooly-2.5.2-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file odooly-2.5.2.tar.gz.

File metadata

  • Download URL: odooly-2.5.2.tar.gz
  • Upload date:
  • Size: 68.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for odooly-2.5.2.tar.gz
Algorithm Hash digest
SHA256 5d1aec4d1dbb43fde6ce29a20fc1531cf551631cce46c2f1b21990abc9ec2757
MD5 6d8369a62ee049e711f0257a45f08ab1
BLAKE2b-256 553a32cd1de132e69de08f1b052d88516091c38f061e9b8409cfdba4b9b86889

See more details on using hashes here.

File details

Details for the file odooly-2.5.2-py3-none-any.whl.

File metadata

  • Download URL: odooly-2.5.2-py3-none-any.whl
  • Upload date:
  • Size: 31.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for odooly-2.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5c8d9e1d7b71378a3d258f26ecc0ec55581f9aab240fc1beabebc231e69bc318
MD5 ce72c2ed977e941e35ad725fb2eb4841
BLAKE2b-256 731efa0c7aedd099c0f86e1c9a41878efc779ee6c7b6deddc8dd7d517079fbca

See more details on using hashes here.

Supported by

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