Odoo Help


xml-rpc search on many2many query

Joeri Belis
on 5/7/13, 12:11 PM 3,203 views

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();
            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?

Naresh Soni (nch)
On 5/7/13, 1:53 PM

Hello Joeri,

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


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

Joeri Belis
on 5/8/13, 11:50 AM

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

Naresh Soni (nch)
on 5/8/13, 2:23 PM
On 5/7/13, 1:34 PM

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


... and here ...


About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 5/7/13, 12:11 PM
Seen: 3203 times
Last updated: 3/16/15, 8:10 AM