[IMP] add warning when removing non global favorite

This commit is contained in:
Géry Debongnie
2014-10-29 08:38:19 +01:00
parent 4554647b87
commit f76e7b4f19
+3 -2
View File
@@ -1768,8 +1768,9 @@ instance.web.search.FavoriteMenu = instance.web.Widget.extend({
},
remove_filter: function (filter, $filter, key) {
var self = this;
var warning = _t("This filter is global and will be removed for everybody if you continue.");
if (!(filter.user_id || confirm(warning))) {
var global_warning = _t("This filter is global and will be removed for everybody if you continue."),
warning = _t("Are you sure that you want to remove this filter?");
if (!confirm(filter.user_id ? warning : global_warning)) {
return;
}
this.model.call('unlink', [filter.id]).done(function () {