Odoo Help


How to do an advanced search of an one2many field?

Juan Formoso
on 1/12/15, 6:24 AM 1,358 views

I created a new field in res.partner model, named rplc. This field is a one2many pointing to other model named res.partner.link.category.

I've checked that if I select rplc in the advanced search, it's filtering by the name or _rec_name of the records of res.partner.link.category. For example, if I go to the advanced search of partners, select rplc and write "Friend" as the content, it looks for every record of res.partner.link.category whose name's "Friend".

Now, my question: res.partner.link.category has other columns (in addition to name), one of them is type.

How can I do if I want to create a filter in the advanced search of res.partner selecting not only name but also type of res.partner.link.category? For example, I want to see every partner whose rplc has any record with name "Friend" and type "Good".

Is this possible? Thank you in advance!

is this question for v7 or v8?

Atchuthan - Technical Consultant, Sodexis Inc
on 1/12/15, 6:40 AM

Sorry, I forgot to specify it, it's a v7.

Juan Formoso
on 1/12/15, 6:48 AM

Could you solve this issue?

MEXYTUL, Diego Calzadilla
on 5/24/15, 5:54 PM

@Diego Calzadilla Now I'm looking why I didn't post my answer earlier and that's because I didn't manage to solve that issue exactly, I have to do a workaround, and I think the final solution is not the answer to this question. In my case, I only wanted to show the *rplc* records which the searched name and always type "*Good*". That was an advantage to do it next way: I had created a one2many of type function, and used the property *fnct_search*. From this property you can call a function made by yourself (you are going to receive the args the user wrote in the search, including the operator). In this function, you can do what you want, but you must return a *domain* (for example: [('id', in, your_list_of_ids)])

Juan Formoso
on 5/25/15, 4:01 AM

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

2 follower(s)


Asked: 1/12/15, 6:24 AM
Seen: 1358 times
Last updated: 5/25/15, 4:01 AM