Skip to main content

Python3 oerlib porting

Project description

License: AGPL-3

Overview

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

It is a fork for python3 of OERPLib project by Sébastien Alix who have not participated to development of this module.

Features

Oerplib3

Oerplib

OdooRPC

XML-RPC protocols

XML-RPC and (legacy) Net-RPC protocols

JSON RPC

Transfer from Odoo >= 6.1 <= 9.0 to Odoo >= 11.0

Transfer from Odoo >= 6.1 <= 9.0 to Odoo >= 6.1 <= 9.0

Transfer from Odoo >= 10.0 to Odoo >= 10.0

access to all methods proposed by a model class (even browse)

same

same

ability to use named parameters with such methods (Odoo >= 6.1)

same

same

user context automatically sent (Odoo >= 6.1) providing support for internationalization

same

same

browse records

same

same

execute workflows

same

same

manage databases

same

same

reports downloading

same

same

inspection capabilities

same

same

Usage

This module work exactly like original OERPLib

import oerplib3 as 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 an OSV 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)

Getting started

Prerequisites

Zeroincombenze(R) tools requires:

  • Linux Centos 7/8 or Debian 9/10/11 or Ubuntu 16/18/20/22/24

  • python 2.7+, some tools require python 3.7+, best python 3.9+

  • bash 5.0+

Installation

Stable version via Python Package

pip install oerplib3

Current version via Git

cd $HOME
[[ ! -d ./tools ]] && git clone https://github.com/zeroincombenze/tools.git
cd ./tools
./install_tools.sh -pUT
source $HOME/devel/activate_tools

Upgrade

Stable version via Python Package

pip install --upgrade oerplib3

Current version via Git

cd ./tools
./install_tools.sh -pUT
source $HOME/devel/activate_tools

ChangeLog History

1.0.0 (2025-01-04)

  • [FIX] Python 3.12 porting

0.8.5 (2024-08-21)

  • [FIX] Python 3.10 porting

0.8.4 (2023-05-06)

  • [FIX] First porting

FAQ

Why this module was forked from OERPlib?

OERPlib runs just with python2 and the author did not migrate package on python3

Why I should use this module? Was it better to use OdooRPC?

OdooRPC runs on python3 but it does not support Odoo xmlrpc protocol. So, if you have to read data from an old Odoo version database, you have to use OERPlib3.

Credits

Authors

Contributors



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

oerplib3-1.0.0.tar.gz (38.8 kB view details)

Uploaded Source

File details

Details for the file oerplib3-1.0.0.tar.gz.

File metadata

  • Download URL: oerplib3-1.0.0.tar.gz
  • Upload date:
  • Size: 38.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.13

File hashes

Hashes for oerplib3-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2344a91ec41a7fc52475d906c75bc61265ac1c988c87255e453b7cf315b5058b
MD5 4dec4376ca6b5f02b15838ee7a66260b
BLAKE2b-256 e957c7812ade9a210190af800f646e6beb7c1f058d30f81d9099d0bf51099277

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