Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

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!

Awatar
Odrzuć
Autor

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

Could you solve this issue?

Autor

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

Powiązane posty Odpowiedzi Widoki Czynność
2
mar 15
5483
2
lis 23
3094
7
kwi 21
20453
1
paź 20
4838
1
lip 19
10695