[IMP] web: Ask user to confirm export template removal

PURPOSE:

When users try to delete records in the database, we usually warn them about the possible damage they would cause by asking them to confirm this is what they want to do (just in case you misclicked for example)

Unfortunately, that feature wasn't implemented everywhere, at least no in the export window, which means a user can remove ir.exports records without having to confirm that's indeed what he wants to do.
This got worsened by the fact, in the export window (like pictured in the attachment), the "Save field list" button is less than 10px away from the DELETE button, meaning you could really remove 10min of your work (or worse, anybody else's work as we don't have any specific record rule on that) in one click
This commit is contained in:
sah
2016-11-04 14:16:14 +01:00
committed by Yannick Tivisse
parent f83944aa85
commit 62c4b0356b
@@ -304,16 +304,21 @@ var DataExport = Dialog.extend({
});
self.$('.o_delete_exported_list').click(function() {
var select_exp = self.$('.o_exported_lists_select option:selected');
if(select_exp.val()) {
self.exports.unlink([parseInt(select_exp.val(), 10)]);
select_exp.remove();
self.$fields_list.empty();
if (self.$('.o_exported_lists_select option').length <= 1) {
self.$('.o_exported_lists').hide();
var options = {
confirm_callback: function () {
if (select_exp.val()) {
self.exports.unlink([parseInt(select_exp.val(), 10)]);
select_exp.remove();
self.$fields_list.empty();
if (self.$('.o_exported_lists_select option').length <= 1) {
self.$('.o_exported_lists').hide();
}
}
}
}
};
Dialog.confirm(this, _t("Do you really want to delete this export template?"), options);
});
});
});
function do_load_export_field(field_list) {
_.each(field_list, function (field) {