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

Hi Guys,

I have a working example using the XMLRPC API search_read method with just one domain filter. (First code snippet below)

However I cannot figure out how to get multiple filters in. In this case OR conditions. I have tried a few different ways but keep getting a response back saying Method Not Allowed.

Examples are coded in Java.

Working Example

List results = Arrays.asList((Object[]) models.execute("execute_kw", Arrays.asList(
db, uid, password,
"account.move", "search_read",
Arrays.asList(Arrays.asList(Arrays.asList("soic_invoice_status", "=", "ready"))),
new HashMap() {{
put("fields", Arrays.asList("name", "invoice_origin", "amount_untaxed", "amount_total", "state", "invoice_payment_state", "soic_invoice_status", "job_reference_number", "partner_id", "partner_shipping_id", "client_id"));
put("limit", 110);
}})));

Not Working

My understanding from other form posts is that the filters should be an Array/List of triples but how should the and/or operators be supplied?

List results = Arrays.asList((Object[]) models.execute("execute_kw", Arrays.asList(
db, uid, password,
"account.move", "search_read",
Arrays.asList(Arrays.asList("|", Arrays.asList("soic_invoice_status", "=", "ready"), Arrays.asList("soic_invoice_status", "=", "resubmit"))),
new HashMap() {{
put("fields", Arrays.asList("name", "invoice_origin", "amount_untaxed", "amount_total", "state", "invoice_payment_state", "soic_invoice_status", "job_reference_number", "partner_id", "partner_shipping_id", "client_id"));
put("limit", 110);
}}
)));


Any help much appreciated.

Update

Turns out the code was correct.

The  Method Not Allowed message getting returned is because something has changed with the authentication on our test server and it was no longer making it past authentication.

Test the code against another server and it works fine. Looks like Administrators hosting our server must have changed some settings.

 


아바타
취소
작성자 베스트 답변

Turns out the code was correct.

The  Method Not Allowed message getting returned is because something has changed with the authentication on our test server and it was no longer making it past authentication.

Tested the code against another server and it works fine. Looks like Administrators hosting our server must have changed some settings.


아바타
취소
관련 게시물 답글 화면 활동
3
1월 23
6252
1
2월 22
4443
1
7월 20
8626
1
1월 24
2362
0
9월 23
27