Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
8499 Prikazi

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.

Avatar
Opusti
Best Answer

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')
);


Avatar
Opusti
Best Answer

Hi Daniel:

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

External API

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
nov. 16
5098
0
dec. 20
4435
1
mar. 18
4117
0
maj 23
2001
1
mar. 24
4755