2012-02-14 6 views
0

open erp hrモジュールをPHPウェブサイトと統合する必要があります。そのためにXML-RPCを使用しようとしました。 しかし、私はそのメソッドにアクセスする方法を取得しませんでした。私は休暇、タイムシート、および給与計算をopen erpから使用する必要があります。PHPからOPENERPメソッドにアクセスするには?

答えて

0

他のCRUDメソッドにアクセスするのと同じ方法でopenerpのメソッドにアクセスできます。 openerp docには記載されていませんが、モデルで定義されたメソッドにアクセスすることは可能です。

次のコードをttps://doc.openerp.com/6.1/developer/12_api/#xml-rpc-web-servicesからopenerp_models.phpファイルに追加します。ダウンロードPHPのLIBは、あなたがこの問題

0

を解決しますが

のPythonを使ってWebサービスを試してみて、使用することを願って

<?php 
    // sample for calling function to validate invoice payment 
    $validate_voucher_payment = $kengen_model->call_function_func('account.voucher', 
     'button_proforma_voucher', array(8)); 
?> 

上記の関数を呼び出す方法を

<?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; 
    } 
} 
?> 

そして、これを提供、Ruby、PHP、Javaプログラミング言語

低リンク

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

私はあなたのための私の答えは、かもしれ役に立つ願っています:)

関連する問題