Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
14421 Переглядів

I'm a user of Odoo 9.0 and I manage a list of 5000 people.

In the list view I have a search box on top, and I would like to perform a search that would give me people whose ID is in a specific list of values. For instance, I'd like to get people number 3, 4, 8, 12, 15, 18, 22, 321, 432, 923, 945, 971, 1434 and 3942.

In SQL it would be something like select * from people where ID in (3, 4, 8, 12, 15, 18, 22, 321, 432, 923, 945, 971, 1434, 3942).

I've looked in the filters where I can add a user-defined filter but it only allows me to filter on 1 specific value, or exclude 1 value, or even return people whose ID < or > to 1 specific value. Not what I'm looking for.

I'd be very grateful if you could help.

Sylvain

Аватар
Відмінити
Найкраща відповідь

The trick is to modify the search view so that ID is searchable without needing a Custom Filter.  

You can add the ID field to the search view, or combine it with the default (first) search view field.

Adding this to the top of the search view would make ID the default search field:

<field name="id" filter_domain="[('id','=',self)]"/>

Then, enter all of the numbers:


Аватар
Відмінити
Автор Найкраща відповідь

Hi Ray,

Thanks for the prompt answer.

I'm just a Odoo user, I'm not an admin and therefore I can't add the field you're mentioning.

Here's what I have :

Search field on top of my "membres" list :

<img src="http://raucy.free.fr/images/cap0.jpg" />

I can search 1 ID (the field to search in is "Base du barre code" which translate as "bar code base" and is an int)

<img src="http://raucy.free.fr/images/cap3.jpg" />

But if I try to enter 2 IDs like that with a "or" (which is a string), the "Base du barre code" option disapears :

<img src="http://raucy.free.fr/images/cap2.jpg" />

I tried to check if I'd search on names :

<img src="http://raucy.free.fr/images/cap2.jpg" />

But nothing comes  out this way :

<img src="http://raucy.free.fr/images/cap5.jpg" />

And finaly, in the user-defined filters, I can't type "or" in an int field :

<img src="http://raucy.free.fr/images/cap4.jpg">


(sorry I couldn't find how to insert images)
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
трав. 23
8872
1
квіт. 22
1819
1
серп. 21
11177
0
черв. 21
2678
1
квіт. 20
3668