summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorsah <sah@odoo.com>2016-09-19 14:55:29 +0530
committerYannick Tivisse <yti@odoo.com>2016-11-04 14:16:14 +0100
commit62c4b0356b0ca5e46a30fbd532666beb0dfc5649 (patch)
treed77dce2202f40c4cd6d4f6462289eacddef23855 /addons/web/static/src
parentf83944aa85b581413e99c76d576c94a7c0ee8c90 (diff)
[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
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/widgets/data_export.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/addons/web/static/src/js/widgets/data_export.js b/addons/web/static/src/js/widgets/data_export.js
index 712adfb89e5..24fb6a41f75 100644
--- a/addons/web/static/src/js/widgets/data_export.js
+++ b/addons/web/static/src/js/widgets/data_export.js
@@ -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) {