Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
8417 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
nov 16
5011
0
dic 20
4337
1
mar 18
4066
0
may 23
1900
1
mar 24
4593