Giter Site home page Giter Site logo

dove-quanta / odoorpc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from osiell/odoorpc

0.0 2.0 0.0 1 MB

Python module to pilot your Odoo servers through JSON-RPC.

Home Page: http://pythonhosted.org/OdooRPC/

License: GNU Lesser General Public License v3.0

Shell 0.15% Python 99.85%

odoorpc's Introduction

OdooRPC

Latest Version Build Status Supported Python versions License

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),

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"

See the documentation for more details and features.

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.

Generate the documentation

To generate the documentation, you have to install Sphinx documentation generator:

pip install sphinx

Then, you can use the build_doc option of the setup.py:

python setup.py build_doc

The generated documentation will be in the ./doc/build/html directory.

Bugs or suggestions

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

Changes in this version

Consult the CHANGELOG file.

odoorpc's People

Contributors

sebalix avatar the-compiler avatar thijstriemstra avatar kvdb avatar rikvermeer avatar

Watchers

James Cloos avatar  avatar

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.