跳至内容
菜单
此问题已终结
2 回复
8777 查看

Hi,

I'm working on an PHP API to connect to Odoo from our external business intranet, developed in Codeigniter PHP.

I can authenticate correctly but when trying to execute a search I get the following error:

AssertionError: Domains to normalize must have a 'domain' form: a list or tuple of domain components

This is the PHP Code used for the request.

$this->xmlrpc->server($this->url.$this->ep_object);

$this->xmlrpc->method('execute_kw'); $request = array(
   array($this->db, 'string'),
array($this->user_id , 'int'),
array($this->password, 'string'),
array('res.partner', 'string'),
array('search', 'string'),
array(
array(
array(
array('is_company', '=', true),
array('customer', '=', true)
)
)
, 'struct')
);
$this->xmlrpc->request($request);
if ( ! $this->xmlrpc->send_request()) {
echo $this->xmlrpc->display_error();
}
else
{                
$val = $this->xmlrpc->display_response(); 
    var_dump($val);
}

As you can see I'm just trying to replicate the API Docs code using the XMLRPC library from CodeIgniter, but the problem is in the last parameter on the request. I don't know what else I could try. Tried already an empty array and so on, with no success.

形象
丢弃
最佳答案

Try to change 'struct' parameter to 'array'. It worked for me.

I.e.

           array('search', 'string'),

array(
array(
array(
array('is_company', '=', true),
array('customer', '=', true)
)
)
, 'array')
);


形象
丢弃
最佳答案

Hi Daniel:

You may want to go through the excellent API documentation with code samples provided by Odoo at the following link:

External API

形象
丢弃
相关帖文 回复 查看 活动
1
11月 16
5409
0
12月 20
4664
1
3月 18
4298
0
5月 23
2249
1
3月 24
5332