From da0d67ae8e44075f28c89b373bdf9c8b465bb1b6 Mon Sep 17 00:00:00 2001 From: ecino Date: Fri, 17 Apr 2015 14:58:55 +0200 Subject: [PATCH] Adujst search_more option to accept True or true values. --- web_m2x_options/static/src/js/form.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index 8459f25f..208e7e92 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -61,16 +61,18 @@ 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 search_more_defined = !_.isUndefined(this.options.search_more) + if((search_more_defined && this.options.search_more.toLowerCase() === "true") || + !(search_more_defined && this.options.search_more.toLowerCase() === "false") && (self.view.ir_options['web_m2x_options.search_more'] === "True")) { + this.search_more = true } - + // add options field_color and colors to color item(s) depending on field_color value this.field_color = this.options.field_color this.colors = this.options.colors - + var dataset = new instance.web.DataSet(this, this.field.relation, self.build_context()); var blacklist = this.get_search_blacklist();