# Welcome to OdooRPC’s documentation!

## Introduction

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

Features supported:
  - access to all data model methods (even `browse`) with an API similar to the server-side API,
  - use named parameters with model methods,
  - user context automatically sent providing support for internationalization,
  - browse records,
  - execute workflows,
  - manage databases,
  - reports downloading,
  - JSON-RPC protocol (SSL supported),

## Quick start

How does it work? See below:

    import odoorpc

    # Prepare the connection to the server
    odoo = odoorpc.ODOO('localhost', port=8069)

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

    # Login
    odoo.login('db_name', 'user', 'passwd')

    # Current user
    user = odoo.env.user
    print(user.name)            # name of the user connected
    print(user.company_id.name) # the name of its company

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

    # Use all methods of a model
    if 'sale.order' in odoo.env:
        Order = odoo.env['sale.order']
        order_ids = Order.search([])
        for order in Order.browse(order_ids):
            print(order.name)
            products = [line.product_id.name for line in order.order_line]
            print(products)

    # Update data through a record
    user.name = "Brian Jones"

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
  - Create a new database
  - Login to your new database
  - Execute RPC queries
  - Browse records
    - Get records
    - Get records corresponding to an External ID
  - Call methods from a Model or from records
  - Update data through records
    - Char, Float, Integer, Boolean, Text and Binary
    - Selection
    - Many2one
    - One2many and Many2many
    - Reference
    - Date and Datetime
  - Download reports
  - Save your credentials (session)
- Frequently Asked Questions (FAQ)
  - Why OdooRPC? And why migrate from OERPLib to OdooRPC?
  - Connect to an Odoo Online (SaaS) instance
  - Update a record with an on_change method
  - Some model methods does not accept the context parameter
  - Change the behaviour of a script according to the version of Odoo
- Reference
  - Browse object fields
  - odoorpc
  - odoorpc.ODOO
  - odoorpc.db
  - odoorpc.report
  - odoorpc.models
  - odoorpc.env
  - odoorpc.rpc
  - odoorpc.session
  - odoorpc.tools
  - odoorpc.error

## Supported Odoo server versions

OdooRPC has been tested on Odoo 8.0, 9.0 and 10.0. It should work on next versions if Odoo keeps a stable API.

## Supported Python versions

OdooRPC support Python 2.7, 3.2, 3.3, 3.4 and 3.5.

## 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

OdooRPC 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