From eed9e34be7dc66d83f2819e0a73e4ac7e17e863e Mon Sep 17 00:00:00 2001 From: Antonio Espinosa Date: Wed, 10 Feb 2016 17:05:51 +0100 Subject: [PATCH] Limit name_search to 160 like Odoo core does --- web_m2x_options/__openerp__.py | 2 +- web_m2x_options/static/src/js/form.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/web_m2x_options/__openerp__.py b/web_m2x_options/__openerp__.py index c87994c7..8a333157 100644 --- a/web_m2x_options/__openerp__.py +++ b/web_m2x_options/__openerp__.py @@ -2,7 +2,7 @@ { "name": 'web_m2x_options', - "version": "8.0.0.2", + "version": "8.0.0.2.0", "depends": [ 'base', 'web', diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index 524197a5..9fe51d23 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -155,9 +155,12 @@ openerp.web_m2x_options = function (instance) { values.push({ label: _t("Search More..."), action: function () { + // limit = 80 for improving performance, similar + // to Odoo implementation here: + // https://github.com/odoo/odoo/commit/8c3cdce539d87775b59b3f2d5ceb433f995821bf dataset.name_search( search_val, self.build_domain(), - 'ilike', false).done(function (data) { + 'ilike', 80).done(function (data) { self._search_create_popup("search", data); }); }, @@ -301,7 +304,10 @@ openerp.web_m2x_options = function (instance) { values.push({ label: _t("Search More..."), action: function() { - dataset.name_search(search_val, self.build_domain(), 'ilike', false).done(function(data) { + // limit = 80 for improving performance, similar + // to Odoo implementation here: + // https://github.com/odoo/odoo/commit/8c3cdce539d87775b59b3f2d5ceb433f995821bf + dataset.name_search(search_val, self.build_domain(), 'ilike', 80).done(function(data) { self._search_create_popup("search", data); }); },