承接 leblanc-simon/openerpbyjsonrpc 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

leblanc-simon/openerpbyjsonrpc

Composer 安装命令:

composer require leblanc-simon/openerpbyjsonrpc

包简介

Library to communicate into PHP and OpenERP (Odoo)

README 文档

README

Communicate with Odoo via JSON-RPC

Installation

composer require leblanc-simon/openerpbyjsonrpc

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

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

Full documentation is available in the docs/ directory:

A condensed reference for AI assistants is available in docs/llms.md.

Development

Quality tooling for contributors:

  • Coding stylePHP CS Fixer with the @Symfony rule set: composer cs-fix (PHP CS Fixer is installed under tools/php-cs-fixer/).
  • Static analysisPHPStan at level 8: vendor/bin/phpstan analyse.
  • Automated refactoringRector: vendor/bin/rector process.
  • TestsPHPUnit: vendor/bin/phpunit.

See Development for the full guide.

License

MIT

Author

Simon Leblanc contact@leblanc-simon.eu

leblanc-simon/openerpbyjsonrpc 适用场景与选型建议

leblanc-simon/openerpbyjsonrpc 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 439 次下载、GitHub Stars 达 2, 最近一次更新时间为 2015 年 07 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「jsonrpc」 「OpenERP」 「odoo」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 leblanc-simon/openerpbyjsonrpc 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 leblanc-simon/openerpbyjsonrpc 我们能提供哪些服务?
定制开发 / 二次开发

基于 leblanc-simon/openerpbyjsonrpc 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 439
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 14
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-22