PHPackages                             leblanc-simon/openerpbyjsonrpc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. leblanc-simon/openerpbyjsonrpc

ActiveLibrary[API Development](/categories/api)

leblanc-simon/openerpbyjsonrpc
==============================

Library to communicate into PHP and OpenERP (Odoo)

3.0.1(2d ago)24394[1 issues](https://github.com/leblanc-simon/openerpbyjsonrpc/issues)MITPHPPHP &gt;= 8.5CI failing

Since Jul 22Pushed 3w ago1 watchersCompare

[ Source](https://github.com/leblanc-simon/openerpbyjsonrpc)[ Packagist](https://packagist.org/packages/leblanc-simon/openerpbyjsonrpc)[ RSS](/packages/leblanc-simon-openerpbyjsonrpc/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (14)Versions (11)Used By (0)

OpenErpByJsonRpc
================

[](#openerpbyjsonrpc)

Communicate with Odoo via JSON-RPC

Installation
------------

[](#installation)

```
composer require leblanc-simon/openerpbyjsonrpc
```

The library depends on a fork of `laminas/laminas-json-server`. Declare the matching VCS repository in your project's `composer.json` before installing:

```
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/leblanc-simon/laminas-json-server"
        }
    ]
}
```

Requirements: PHP `>= 8.5` and the `ext-json` extension.

Usage
-----

[](#usage)

```
use OpenErpByJsonRpc\JsonRpc\ZendJsonRpc;
use OpenErpByJsonRpc\JsonRpc\OpenERP;
use OpenErpByJsonRpc\Storage\FileStorage;
use OpenErpByJsonRpc\Client\Session;
use OpenErpByJsonRpc\Client\Database;
use OpenErpByJsonRpc\Client\Model;
use OpenErpByJsonRpc\Criteria;

$jsonrpc = new ZendJsonRpc('http://odoo.com');
$odoo = new OpenERP($jsonrpc, new FileStorage([
    'directory' => 'path/to/cache',
    'prefix' => 'session_',
]));

$odoo
    ->setBaseUri('http://odoo.com')
    ->setPort(null)
    ->setUsername('admin')
    ->setPassword('admin')
    ->setDatabase('main')
    ->reconnectOrLogin(null)
;

// If you use FileStorage, you can reconnect without username and password
// $sessionId can be retrieve via Session::getInfos()
$odoo->reconnectOrLogin($sessionId);

///////////////////////////////
// Model methods
//
$model = new Model($odoo);

// Read a single record
$model->readOne('res.users', 1, ['id', 'login']);

// Search records
// * use array for criteria
$model->search('res.users', [['login', '=', 'admin']], ['id', 'login']);

// * use Criteria class : search login = admin AND name = admin
$criteria = new Criteria();
$criteria
    ->equal('login', 'admin')
    ->equal('name', 'admin')
;
$model->search('res.users', $criteria, ['id', 'login']);

// Create record
$id = $model->create('res.partner', [
    'name' => 'Jean Dupont',
    'function' => 'DRH',
    'phone' => '+330120304050',
]);

// Update record
$model->write('res.partner', $id, [
    'name' => 'Jean Dupond',
]);

// Delete record
$model->remove('res.partner', $id);

///////////////////////////////
// Session methods
//
$session = new Session($odoo);

// Get the session informations
$session->getInfos();

// Get the availables languages
$session->getLangList();

// Get the availables modules
$session->getModules();

// Change your current password
$session->changePassword('admin', 'new pass');

///////////////////////////////
// Database methods
//
$database = new Database($odoo);

// Get the list of available database
$database->getList();

// Create a new database
$database->create(
    'master password', // your master password in your odoo config file
    'database_name',
    false, // true if you want add demo data
    'fr_FR',
    'admin' // the admin password for the created database
);

// Duplicate a database
$database->duplicate(
    'master password', // your master password in your odoo config file
    'database_to_duplicate',
    'new_database'
);

// Drop a database
$database->drop(
    'master password', // your master password in your odoo config file
    'database_name'
);
```

Documentation
-------------

[](#documentation)

Full documentation is available in the [`docs/`](docs/README.md) directory:

- [Getting started](docs/getting-started.md)
- [Connection &amp; authentication](docs/connection-and-authentication.md)
- [Working with records](docs/working-with-records.md)
- [Building queries](docs/building-queries.md)
- [Sessions](docs/sessions.md)
- [Databases](docs/databases.md)
- [Session storage](docs/session-storage.md)
- [Error handling](docs/error-handling.md)
- [API reference](docs/api-reference.md)
- [Development](docs/development.md)

A condensed reference for AI assistants is available in [`docs/llms.md`](docs/llms.md).

Development
-----------

[](#development)

Quality tooling for contributors:

- **Coding style** — [PHP CS Fixer](https://cs.symfony.com/) with the `@Symfony`rule set: `composer cs-fix` (PHP CS Fixer is installed under `tools/php-cs-fixer/`).
- **Static analysis** — [PHPStan](https://phpstan.org/) at level 8: `vendor/bin/phpstan analyse`.
- **Automated refactoring** — [Rector](https://getrector.com/): `vendor/bin/rector process`.
- **Tests** — [PHPUnit](https://phpunit.de/): `vendor/bin/phpunit`.

See [Development](docs/development.md) for the full guide.

License
-------

[](#license)

[MIT](http://opensource.org/licenses/MIT)

Author
------

[](#author)

Simon Leblanc

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance87

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~799 days

Recently: every ~969 days

Total

6

Last Release

2d ago

Major Versions

v0.0.9 → v1.0.02015-11-21

v1.0.0 → 2.0.02020-10-15

2.1.0 → 3.0.02026-06-11

PHP version history (3 changes)2.0.0PHP &gt;=7.3

2.1.0PHP ^7.3 || ~8.0.0 || ~8.1.0

3.0.0PHP &gt;= 8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/2fc78f90d0b6d0192015d2262e2d8349c17a46b28c23f0f8ea9f0399ebf8d038?d=identicon)[leblanc-simon](/maintainers/leblanc-simon)

---

Top Contributors

[![leblanc-simon](https://avatars.githubusercontent.com/u/605746?v=4)](https://github.com/leblanc-simon "leblanc-simon (16 commits)")

---

Tags

jsonrpcOpenERPodoo

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/leblanc-simon-openerpbyjsonrpc/health.svg)

```
[![Health](https://phpackages.com/badges/leblanc-simon-openerpbyjsonrpc/health.svg)](https://phpackages.com/packages/leblanc-simon-openerpbyjsonrpc)
```

###  Alternatives

[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[obuchmann/odoo-jsonrpc

PHP Odoo Json-RPC connector, prepared for laravel integration

6256.8k1](/packages/obuchmann-odoo-jsonrpc)[edujugon/laradoo

Odoo ERP API for Laravel

16268.9k](/packages/edujugon-laradoo)[drlecks/simple-web3-php

Web3 library in PHP

7744.0k2](/packages/drlecks-simple-web3-php)[sergeyfast/eazy-jsonrpc

PHP JSON-RPC 2.0 Server/Client Implementation with SMD &amp; Swagger support

6164.3k](/packages/sergeyfast-eazy-jsonrpc)[spejder/odoo-client

A PHP Client for Odoo

1019.7k3](/packages/spejder-odoo-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
