From 2b90e054bbfee61596a1c71f6a71d92135b98e71 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 17 Apr 2015 10:06:14 +0200 Subject: [PATCH] [FIX] web: keep domain with search field Currently (since commit e6a2d222d6), the domain of a search view field tag is dropped. This previous change was done since some of these domains refers to a field not available in the javascript. This fix drop the domain only if it can't be evaluated in the javascript side. opw-632030 --- addons/web/static/src/js/search.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 5ab5952f161..d39ed55b638 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1647,9 +1647,17 @@ instance.web.search.ManyToOneField = instance.web.search.CharField.extend({ // FIXME: "concurrent" searches (multiple requests, mis-ordered responses) var context = instance.web.pyeval.eval( 'contexts', [this.view.dataset.get_context()]); + var args = this.attrs.domain; + if(typeof args === 'string') { + try { + args = instance.web.pyeval.eval('domain', args); + } catch(e) { + args = []; + } + } return this.model.call('name_search', [], { name: needle, - args: (typeof this.attrs.domain === 'string') ? [] : this.attrs.domain, + args: args, limit: 8, context: context }).then(function (results) {