[IMP] don't trigger three searches when creating an advanced search with three conditions

bzr revid: xmo@openerp.com-20120403095146-26emkw284lxrahwk
This commit is contained in:
Xavier Morel 2012-04-03 11:51:46 +02:00
parent ac5eed3c6c
commit 7f80cd83fc
1 changed files with 9 additions and 2 deletions

View File

@ -1311,8 +1311,15 @@ openerp.web.search.Advanced = openerp.web.search.Input.extend({
});
// Create Filter (& FilterGroup around it) with that domain
var f = new openerp.web.search.FilterGroup(filters, this.view);
// add FilterGroup to this.view.searchQuery
_(filters).each(function (filter) { f.toggle(filter); });
// add group to query
this.view.vs.searchQuery.add({
category: 'q',
value: _(filters).map(function (f) {
return f.attrs.string || f.attrs.name }).join(' | '),
json: filters,
field: f,
app: this.view.vs
});
// remove all propositions
_.invoke(children, 'destroy');
// add new empty proposition