콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
8524 화면

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
5110
0
12월 20
4453
1
3월 18
4126
0
5월 23
2012
1
3월 24
4789