'Search more...' for inaccurate names is slow

Bug #1234226 reported by Daniel Hammerschmidt
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Undecided
Unassigned
Odoo Web (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

The action of the 'Search more...'-button of many2one-autocompletion-lists invokes name_search() with the current value of the input-element and without a limit. On the server name_search() invokes name_get() for each matching record. Later in the web-client if the search-popup is created, the returned names are discarded and just the ids are used for initialization.

If the user hits 'Search more..' with an empty (or inaccurate, e.g. 'e') search-value this might take a long time, i.e. if a model implements its own name_get() (e.g. res.partner).

My idea is to add a flag to the context dictionary to tell name_search() to just return the ids. To do this we need to change the action for 'Search more...' in instance.web.form.CompletionFieldMixin.get_search_result() and BaseModel._name_search().

(I will push two branches for this issue.)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.