### Navigation

- index
- modules |
- next |
- OERPLib 0.8 documentation »

# Welcome to OERPLib’s documentation!

## Introduction

OERPLib is a Python module providing an easy way to pilot your OpenERP and Odoo servers through RPC.

Features supported:
  - XML-RPC and (legacy) Net-RPC protocols,
  - access to all methods proposed by a model class (even `browse`) with an API similar to the server-side API,
  - ability to use named parameters with such methods (server >= 6.1),
  - user context automatically sent (server >= 6.1) providing support for internationalization,
  - browse records,
  - execute workflows,
  - manage databases,
  - reports downloading,
  - inspection capabilities (graphical output of relations between models and dependencies between modules, list `on_change` methods from model views, ...).

## Quick start

How does it work? See below:

    import oerplib

    # Prepare the connection to the server
    oerp = oerplib.OERP('localhost', protocol='xmlrpc', port=8069)

    # Check available databases
    print(oerp.db.list())

    # Login (the object returned is a browsable record)
    user = oerp.login('user', 'passwd', 'db_name')
    print(user.name)            # name of the user connected
    print(user.company_id.name) # the name of its company

    # Simple 'raw' query
    user_data = oerp.execute('res.users', 'read', [user.id])
    print(user_data)

    # Use all methods of a model class
    order_obj = oerp.get('sale.order')
    order_ids = order_obj.search([])
    for order in order_obj.browse(order_ids):
        print(order.name)
        products = [line.product_id.name for line in order.order_line]
        print(products)

    # Update data through a browsable record
    user.name = "Brian Jones"
    oerp.write_record(user)

For more details and features, see the tutorials, the Frequently Asked Questions (FAQ) and the API reference sections.

## Contents

- Download and install instructions
  - Python Package Index (PyPI)
  - Source code
  - Run tests
- Tutorials
  - First step: prepare the connection and login
  - Execute queries
  - Browse records
  - Update data through browsable records
    - Char, Float, Integer, Boolean, Text and Binary
    - Selection
    - Many2One
    - One2Many and Many2Many
    - Reference
    - Date and Datetime
  - Generate reports
  - Manage databases
  - Inspect the metadata of your server (New in version 0.8)
    - Draw a graph of relationships between models
    - Draw a graph of module dependencies
    - Scan the views of data models to list on_change methods
  - Save the session to open it quickly later (New in version 0.8)
  - Change the timeout
- Frequently Asked Questions (FAQ) (New in version 0.8)
  - Connect to an OpenERP Online (SaaS) instance
  - Update a record with an on_change method
  - Some OSV methods does not accept the context parameter
  - Change the behaviour of a script according to the version of OpenERP
- Reference
  - Browse object fields
  - oerplib
  - oerplib.OERP
  - oerplib.service.osv
    - oerplib.service.osv.Model
    - oerplib.service.osv.BrowseRecord
  - oerplib.service.common
  - oerplib.service.db
  - oerplib.service.wizard
  - oerplib.service.inspect (New in version 0.8)
    - oerplib.service.inspect.Inspect
    - oerplib.service.inspect.Relations
    - oerplib.service.inspect.Dependencies
  - oerplib.rpc
    - XML-RPC and Net-RPC connectors
    - JSON-RPC connectors (New in version 0.8)
  - oerplib.tools
  - oerplib.tools.session (New in version 0.8)
  - oerplib.error

## Supported OpenERP/Odoo server versions

OERPLib has been tested on OpenERP server v5.0, v6.0, v6.1, v7.0 and Odoo v8.0. It should work on next versions if Odoo keeps a stable API.

## Supported Python versions

OERPLib support Python versions 2.6, 2.7.

## License

This software is made available under the LGPL v3 license.

## Bugs or suggestions

Please, feel free to report bugs or suggestions in the Bug Tracker!

## Make a donation

OERPLib is mainly developed on free time. To show your appreciation and support this project, it is possible to make a donation through PayPal:

# Indices and tables

- Index
- Module Index
- Search Page

### Navigation

- index
- modules |
- next |
- OERPLib 0.8 documentation »