[IMP] add confirmation message when removing a global custom filter

lp bug: https://launchpad.net/bugs/1103410 fixed

bzr revid: xmo@openerp.com-20130123105320-pbmeqoudpb48s87m
This commit is contained in:
Xavier Morel 2013-01-23 11:53:20 +01:00
parent ca038643b9
commit 8192977f3c
1 changed files with 4 additions and 0 deletions

View File

@ -1608,6 +1608,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
append_filter: function (filter) {
var self = this;
var key = this.key_for(filter);
var warning = _t("This filter is global and will be removed for everybody if you continue.");
var $filter;
if (key in this.$filters) {
@ -1625,6 +1626,9 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
$('<a class="oe_searchview_custom_delete">x</a>')
.click(function (e) {
e.stopPropagation();
if (!(filter.user_id || confirm(warning))) {
return;
}
self.model.call('unlink', [id]).done(function () {
$filter.remove();
delete self.$filters[key];