[FIX] small issue with adding an attribute called 'id' to a backbone model

triggers backbone's thinking that the model is 'not new' and trying to sync it with a remote on e.g. removal

bzr revid: xmo@openerp.com-20130131135125-1x7czib7q0kafok8
This commit is contained in:
Xavier Morel 2013-01-31 14:51:25 +01:00
parent 9b3e333d67
commit 0ad34228e2
1 changed files with 2 additions and 2 deletions

View File

@ -1598,7 +1598,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
get_groupby: function () { return [filter.context]; },
get_domain: function () { return filter.domain; }
},
id: filter['id'],
_id: filter['id'],
is_custom_filter: true,
values: [{label: filter.name, value: null}]
};
@ -1645,7 +1645,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
},
toggle_filter: function (filter, preventSearch) {
var current = this.view.query.find(function (facet) {
return facet.get('id') === filter.id;
return facet.get('_id') === filter.id;
});
if (current) {
this.view.query.remove(current);