我需要集成的开放erp的人力资源模块与php,我试图使用XML- website.For。但是我不知道如何访问它的方法,我需要使用开放erp中的休假、时间表和工资计算。
发布于 2012-02-18 18:44:55
这将会有所帮助。
http://doc.openerp.com/v6.0/developer/6_22_XML-RPC_web_services/index.html。
发布于 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
<?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;
}
}
?>
下面是调用上述函数的方法
<?php
// sample for calling function to validate invoice payment
$validate_voucher_payment = $kengen_model->call_function_func('account.voucher',
'button_proforma_voucher', array(8));
?>
希望这能解决你的问题
发布于 2016-01-19 20:26:20
您可以使用以下命令尝试和使用web服务
Python、Ruby、PHP和Java编程语言
只需点击下面的链接
https://www.odoo.com/documentation/8.0/api_integration.html
我希望我的答案能对你有所帮助:)
https://stackoverflow.com/questions/9274773
复制相似问题