Odoo Help


many2one form view search record limit

on 9/10/13, 12:04 PM 3,235 views

In openerp 7 Form view many2one field box if entered value "a" default search 7 records. How to increase limit upto 25 records. I overridden name and name_search method to increase the limit to 25. After that in search view many2one field limit increased successfully but in the form view only shows 7 record. How to increase in many2one field search records in form view?

On 4/20/15, 2:52 PM

In the web module look for the file 'view_form.js'

web > static > src > js > view_form.js

search for this line: 'instance.web.form.CompletionFieldMixin'  ( its on line 2898 for me )

below that line is an init function.  Change this.limit = 7;  to this.limit = 25;

Note - I was able to add some dynamic ability by using a javascript ternary statement like this:

this.limit = this.name == 'stage_id' ? 25 : 7;

the 'stage_id' is the name of the stage field for the crm_leads table.  In this case it would show 25 records if the stage_id dropdown list is clicked, otherwise it sets the limit to the default 7 records for the other many2one fields.  Feel free to modify it however you need


Grover Menacho

--Grover Menacho--
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Odoo Developer

Grover Menacho
On 9/10/13, 12:53 PM

RIght here there is a module that does what you want:


poi_limit_search adds a field on General Settings where you have to change the value and a many2one field is going to have that limit of values.

Thanks for reply limit value set in the file view_form.js. Is it possible to increase the limit for particular custom module form. If possible please give me sample code.

on 9/10/13, 12:59 PM

Answer updated. Please check it.

GH Mediacloud, Grover Menacho
on 9/10/13, 8:16 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 9/10/13, 12:04 PM
Seen: 3235 times
Last updated: 4/20/15, 2:52 PM