From dacf7553f48ff9389374737ed2444849ed6a3040 Mon Sep 17 00:00:00 2001 From: msh-openerp Date: Tue, 22 May 2012 09:50:46 +0530 Subject: [PATCH 1/2] [FIX]Fixed the issue of advance filter, removed the fields which are not searchable or on which fnct_search is false or store is false, here from xml we have removed it but in js when it goes to call select_field at that time these fields will be available in this.fields. bzr revid: msh@tinyerp.com-20120522042046-vlp0nacy0cml54vb --- addons/web/static/src/js/search.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 85dca8a91e3..b4336cf46a2 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1220,7 +1220,13 @@ openerp.web.search.ExtendedSearchProposition = openerp.web.OldWidget.extend(/** */ init: function (parent, fields) { this._super(parent); - this.fields = _(fields).chain() + filtered_fields = {} + _.each(fields, function(field, name){ + if(typeof field.store === 'undefined' || field.store || field.fnct_search){ + filtered_fields[name] = field + } + }); + this.fields = _(filtered_fields).chain() .map(function(val, key) { return _.extend({}, val, {'name': key}); }) .sortBy(function(field) {return field.string;}) .value(); From 63717f865167ae99e14129cd7f9f847c8dfa8113 Mon Sep 17 00:00:00 2001 From: msh-openerp Date: Wed, 13 Jun 2012 12:43:06 +0530 Subject: [PATCH 2/2] [FIX]Refix the issue, used filter in current chain process instead of each. bzr revid: msh@tinyerp.com-20120613071306-9o50h0xxcg6dheda --- addons/web/static/src/js/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 36db9ee5b47..87023f7e98d 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1221,8 +1221,8 @@ openerp.web.search.ExtendedSearchProposition = openerp.web.OldWidget.extend(/** init: function (parent, fields) { this._super(parent); this.fields = _(fields).chain() - .filter(function(field){return typeof field.store === 'undefined' || field.store || field.fnct_search}) .map(function(val, key) {return _.extend({}, val, {'name': key}); }) + .filter(function(field){return typeof field.store === 'undefined' || field.store || field.fnct_search}) .sortBy(function(field) {return field.string;}) .value(); this.attrs = {_: _, fields: this.fields, selected: null};