Skip to Content
Menu
This question has been flagged

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!

Avatar
Discard
Author

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

Could you solve this issue?

Author

@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)])

Related Posts Replies Views Activity
2
Mar 15
5022
2
Nov 23
2103
7
Apr 21
19390
1
Oct 20
4013
1
Jul 19
10093