Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
9628 มุมมอง

I want to search all res_users that belong to a certain res_company via xml-rpc. The test client is written in .net env. When i keep the search query simple like searching on the "login" field = 'login_name_x' this works fine.

            String[] condition = new String[] { "login", "=", "name_x" };
            ArrayList lstFilters = new ArrayList();
            lstFilters.Add(condition);
            Object[] resSearch = openERPproxy.search(dbname, userID, pwd,res.users",search", lstFilters.ToArray());

But i need to filter on de company_ids where a res_users records belongs to. So i tried following filter as i know there are res_users in company_id 3

            String[] condition = new String[] { "company_ids", "=", "3" };

But this is not a working solution because it returns nothing?!

What is the correct approach to get xml-rpc do search filter on the many2xxx fields?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Joeri,

use String[] condition = new String[] { "company_ids", "in", [3] };

Thanks,

อวตาร
ละทิ้ง
ผู้เขียน

[3] is not working, it needs to be a string. but no success yet

Joeri, not sure how do you write a list([]) in .net but OpenERP will expect a list here as company_ids is a Many2many

คำตอบที่ดีที่สุด

You can find some examples of XMLRPC usage here ...

https://gist.github.com/t3dev/3016471

... and here ...

GData_OpenERP_Data_Pump

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 15
6872
2
มี.ค. 15
8024
1
มี.ค. 15
4084
0
ธ.ค. 24
9465
3
ก.ย. 24
21665