首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何从PHP访问OPENERP方法?

如何从PHP访问OPENERP方法?
EN

Stack Overflow用户
提问于 2012-02-14 17:49:36
回答 3查看 5.5K关注 0票数 0

我需要集成的开放erp的人力资源模块与php,我试图使用XML- website.For。但是我不知道如何访问它的方法,我需要使用开放erp中的休假、时间表和工资计算。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2012-02-18 18:44:55

这将会有所帮助。

http://doc.openerp.com/v6.0/developer/6_22_XML-RPC_web_services/index.html

票数 1
EN

Stack Overflow用户

发布于 2013-12-09 21:59:27

您可以像访问其他CRUD方法一样访问openerp中的方法。它没有在openerp文档中记录,但可以访问模型中定义的方法。

将以下代码添加到来自ttps://doc.openerp.com/6.1/developer/12_api/#xml-rpc-web-services.的openerp_models.php文件中下载提供的php lib

代码语言:javascript
运行
复制
<?php

public function call_openerp_func($model, $function, $ids) {

    $client = new xmlrpc_client($this->server . "object");

    $id_val = array();
    $count = 0;
    foreach ($ids as $id) {
        $id_val[$count++] = new xmlrpcval($id, "int");
    }



    $this->msg = new xmlrpcmsg('execute');
    $this->msg->addParam(new xmlrpcval($this->database, "string"));
    $this->msg->addParam(new xmlrpcval($this->id, "int"));
    $this->msg->addParam(new xmlrpcval($this->password, "string"));
    $this->msg->addParam(new xmlrpcval($model, "string"));
    $this->msg->addParam(new xmlrpcval($function, "string"));
    $this->msg->addParam(new xmlrpcval($id_val, "array"));
    //////         
     */
    // Functions return values
    $this->res = &$this->client->send($this->msg);
    if ($this->res->faultCode()) {
        return 'Error: ' . $resp->faultString();
    } else {
        $res = $this->res->value();
        return $res;
    }
}
 ?>

下面是调用上述函数的方法

代码语言:javascript
运行
复制
<?php
  // sample for calling function to validate invoice payment
   $validate_voucher_payment = $kengen_model->call_function_func('account.voucher', 
      'button_proforma_voucher', array(8));  
?>

希望这能解决你的问题

票数 0
EN

Stack Overflow用户

发布于 2016-01-19 20:26:20

您可以使用以下命令尝试和使用web服务

Python、Ruby、PHP和Java编程语言

只需点击下面的链接

https://www.odoo.com/documentation/8.0/api_integration.html

我希望我的答案能对你有所帮助:)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9274773

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档