forked from Techsystech/web
Add an option to m2x_options to force enable/disable search more button
parent
475de57f88
commit
3e79de1c60
|
@ -59,6 +59,11 @@ openerp.web_m2x_options = function (instance) {
|
||||||
this.limit = this.options.limit;
|
this.limit = this.options.limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add options search_more to force enable or disable search_more button
|
||||||
|
if(typeof this.options.search_more === 'boolean') {
|
||||||
|
this.search_more = this.options.search_more
|
||||||
|
}
|
||||||
|
|
||||||
var dataset = new instance.web.DataSet(this, this.field.relation,
|
var dataset = new instance.web.DataSet(this, this.field.relation,
|
||||||
self.build_context());
|
self.build_context());
|
||||||
var blacklist = this.get_search_blacklist();
|
var blacklist = this.get_search_blacklist();
|
||||||
|
@ -95,7 +100,7 @@ openerp.web_m2x_options = function (instance) {
|
||||||
|
|
||||||
// search more... if more results that max
|
// search more... if more results that max
|
||||||
|
|
||||||
if (values.length > self.limit) {
|
if (values.length > self.limit || self.search_more) {
|
||||||
values = values.slice(0, self.limit);
|
values = values.slice(0, self.limit);
|
||||||
values.push({
|
values.push({
|
||||||
label: _t("Search More..."),
|
label: _t("Search More..."),
|
||||||
|
|
Loading…
Reference in New Issue