diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index 4e3801eb..d49c2af0 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -58,6 +58,11 @@ openerp.web_m2x_options = function (instance) { if (typeof this.options.limit === 'number') { 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, self.build_context()); @@ -95,7 +100,7 @@ openerp.web_m2x_options = function (instance) { // 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.push({ label: _t("Search More..."),