From cbe5d731647a968169f5055f03a10ce90a028af8 Mon Sep 17 00:00:00 2001 From: David Coninckx Date: Fri, 27 Mar 2015 14:24:07 +0100 Subject: [PATCH] Add an option to m2x_options to force enable/disable search more button --- web_m2x_options/static/src/js/form.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index e4540567..0975a069 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -60,6 +60,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()); @@ -100,7 +105,7 @@ openerp.web_m2x_options = function (instance) { // search more... if more results than 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..."),