Giter Site home page Giter Site logo

erppeek's Introduction

ERPpeek, a versatile tool for browsing Odoo / OpenERP data

Download and install the latest release:

pip install -U https://github.com/savoirfairelinux/erppeek/archive/master.zip

Documentation and tutorial: http://erppeek.readthedocs.org

ERPpeek carries three completing uses:

  1. with command line arguments
  2. as an interactive shell
  3. as a client library

Key features:

  • single executable erppeek.py, no external dependency
  • wrappers for search+read, for data model introspection, etc...
  • simpler syntax for domain and fields
  • full API accessible on the Client object for OpenERP 5.0 through Odoo 8.0
  • the module can be imported and used as a library: from erppeek import Client
  • supports Python 3 and Python 2 (>= 2.6)
  • supports SFLvault if installed

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

$ erppeek --help
Usage: erppeek [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: 'erppeek.ini')
  --server=SERVER       full URL to the XML-RPC server (default: http://localhost:8069)
  -d DB, --db=DB        database
  -u USER, --user=USER  username
  -s SFLVAULT, --sflvault=SFLVAULT
                        sflvault VaultID for password
  -p PASSWORD, --password=PASSWORD
                        password, or it will be requested on login
  -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:

$ erppeek -d demo -m res.partner -f name -f lang 1
"name","lang"
"Your Company","en_US"
$ erppeek -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"

Edit erppeek.ini and declare the environment(s):

[DEFAULT]
scheme = http
host = localhost
port = 8069
database = openerp
username = admin
options = -c /path/to/openerp-server.conf --without-demo all

[demo]
username = demo
password = demo

[local]
scheme = local

Connect to the Odoo server:

erppeek --list
erppeek --env demo

This is a sample session:

>>> model('res.users')
<Model 'res.users'>
>>> model('res.users').count()
4
>>> model('ir.cron').read(['active = False'], 'active function')
[{'active': False, 'function': 'run_mail_scheduler', 'id': 1},
 {'active': False, 'function': 'run_bdr_scheduler', 'id': 2},
 {'active': False, 'function': 'scheduled_fetch_new_scans', 'id': 9}]
>>> #
>>> client.modules('delivery')
{'uninstalled': ['delivery', 'sale_delivery_report']}
>>> client.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
  ...
>>> #

Note

Use the --verbose switch to see what happens behind the scene. Lines are truncated at 79 chars. Use -vv or -vvv to print more.

Note

To preserve the history of commands when closing the session, first create an empty file in your home directory: touch ~/.erppeek_history

erppeek's People

Contributors

florentx avatar lepistone avatar nbessi avatar omacchioni avatar yvaucher avatar

Watchers

James Cloos avatar Sandy avatar Alexandre Viau avatar  avatar

Forkers

nucleoos

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.