Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
14420 Visualizzazioni

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

Avatar
Abbandona
Risposta migliore

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:


Avatar
Abbandona
Autore Risposta migliore

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)
Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
mag 23
8872
1
apr 22
1819
1
ago 21
11177
0
giu 21
2678
1
apr 20
3668