Odoo Help


This community 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.


xml-rpc search on many2many query

Joeri Belis
on 5/7/13, 12:11 PM 2,503 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?



| 5 6 8
Cornwall, Canada

Analysing, designing, coding and mentoring since 1975. Kilobytes to terabytes. Punch cards to punchy sites. My OpenERP video series: http://www.youtube.com/playlist?list=PLq7op4J183lX44ZlXPiHxUpRvmmRDtxye My Google Speadsheets --> OpenERP Data Pump project: http://martinhbramwell.github.io/GData_OpenERP_Data_Pump My email (with spaces removed) : mhb . warehouseman @ gmail . com

On 5/7/13, 1:34 PM

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


... and here ...



Naresh Soni (nch)

--Naresh Soni (nch)--
Tiny ERP Pvt Ltd
| 2 2 4
--Naresh Soni (nch)--

Team Lead, Odoo(Formerly OpenERP) Support & OPW

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


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