search view - criteria are m2o fields instead of substring search

Bug #748238 reported by Ferdinand on 2011-04-02
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Web Client

Bug Description

the web client displays filter fields as m2o instead of char fields
hence it is only possible to filter one criteria while in GTK a (more) substring filter is implemented

this is limiting the usefulness of the analyses tool

Related branches

Ferdinand (office-chricar) wrote :

Hi Ferdinand,

it is possible to perform substring searches by pressing escape when the combobox offers you the suggestions.

On the contrary, the problem is rather that the m2o fields *imply* to be able to search for particular resources but they perform a substring search even then.


Ferdinand (office-chricar) wrote :

i know but in the combobox only ONE record (id) is available
and the search results use only this id for searching.

Example Invoices
2 partners of a group have similar names

ABC test1
ABC test2

in GTK
* enter ABC and hit search
all INV etc of BOTH partners are shown

in WEB
* enter ABC
--> must select either ABC test1 oder ABC test2
resources of only the selected partenr is shown.

this limits the flexibility of searchin in WEB compared to GTK a lot.

Try this:

in the web client
* enter ABC
* wait until combobox offers suggestions
* press ESC so that the suggestions disappear

This should retrieve both "ABC test1" and "ABC test2"


Ferdinand (office-chricar) wrote :

if I follow your suggestions
in customer invoices
* enter abc in "Partner"
->> gat a combobox with matching partners
* press esc
--> abc is visible in the partner combobox
* click search
--> partner lists opens with all matching partners
-- have to select ONE of the partner list
and will get only the invoices of this particular partner and not the invoices of all

server 3349
addons 4408
web 4519


thanks for your explanation. I confirm your findings. In fact the only place where I can reproduce my findings are in a custom module, so it only occurs in a very specific combination of circumstances. Which is unfortunate, as I agree that the introduction of the combobox in one(!) of the clients is a step backwards.


Ferdinand (office-chricar) wrote :

this problem occurs everywhere (standard modules) where partner or products etc are referenced as m2o like in

Yes, so I have noticed yesterday. There is only one place where I can escape from the combobox, and it is a field in a custom module of ours. Ironically, it is clearly a bug in the web client that allowed for the desired behaviour.

The associated branch allows the user to perform a substring search on a many2one field in a search view, if and only if the user presses ESC when the combobox shows its suggestions.

Hello Guys,

It is not like a bug in the web client.
As per comment #3, its working fine as expected And its not like a limits of searching in web.

If there are two different country like "India North" and "India South" And user want to get only records which referenced from only "India North" than by m2o search (id) they get all records from that country only, not the records combine with country "India South" because It should be different country.

Please note that Web client offers many2one widget so the query formed will be comprising of '=',
Where as in GTK they offer char widget so the query formed should be "ilike".

So if we stick on your view then we either need to change the widget to char. which I feel does not seems feasible or GTK needs to change the widget to many2one. For now I am converting the bug to "Wishlist".


Changed in openobject-client-web:
importance: Undecided → Wishlist

Hi Jiten,

thank you for your response.

I believe you are not correct with regards about the query operator applied by the many2one search widget. The many2one search widget does in fact not use the '=' operator, but the 'like' operator in every case. That is the topic of lp:751197, which you have just marked as a duplicate. I do not agree that lp:751197 is a duplicate of this bug.

The topic of this bug is that in the webclient it is impossible to select items by a substring search on a many2one field (i.e. select partners from North Korea and South Korea at the same time), because the search widget only allows to search for complete names of many2one items. In the GTK client, it is possible. Therefore the possibilities to selelect items by a many2one field are limited.

You also remark that this bug cannot easily be solved for architectural reasons, as if the widget should somehow be modified to handle char input. The widget already does in fact behave as a char field, except that it forces the user to choose from a limited number of options as its content.

If you agree that pressing ESC at the combobox is an acceptable scenario for the user to trigger substring search, then my branch fixes the bug in four lines of code.


Note that the impact of this issue is somewhat mitigated by the ability to apply a custom filter which does allow to search for substring on a many2one. Still, the fact that no one in this discussion has observed this until now illustrates the usability aspect.

Navrang Oza (noz-tiny) wrote :

Hello all,

I think there is some misunderstanding in communication.
Actually this problem has been fixed in trunk and not in stable.

Here I am committing in stable too with revision:
4578 <email address hidden>

For Web-Client, the actual behavior will be like:
If user will select any particular value from auto suggestion box then '=' domain will apply,
And if substring and Escape to come out from auto suggestion box, then 'ilike' domain will apply.

So i think this information is enough to explain the behavior.

Thanks for patience.

Ferdinand (office-chricar) wrote :

looks good now - but still a little issue

to reproduce:

enter substring, Escape, Enter
-> search is correctly executed, but suggestion box opens again - IMHO this should not be the case.

Ferdinand (office-chricar) wrote :

still another issue
not all results which are displayed in the suggestion box are returned in the address list
neither with
* escape
nor if
* selecting a particular value

I have base_contact installed

Navrang Oza (noz-tiny) wrote :

Hello Ferdinand,

You are pressing 'Enter' key when your cursor is in many2one field.
So obviously it will open suggestion box again.

After ESC, you have to click on SEARCH button to get the result.


Ferdinand (office-chricar) wrote :


"Enter" executes the search as well as a click on the "Search button"

we should try to avoid unnecessary mouse clicks.

Navrang Oza (noz-tiny) wrote :

Try like this, you will get the exact behavior.

Enter substring, then from suggestion box, select any one by ENTER key.
Suggestion box will disappear and value get selected.

Now if you will enter again, to fire SEARCH result, then result will be there, but it will activate suggestion box again because field is focused.

We have to remove focus from there.
If we will remove focus from there then suggestion box will not work properly.

Its like you are typing something after pressing ENTER key :)
So i think this should be final case.


Changed in openobject-client-web:
milestone: none → 6.0.3
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments