Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
on_attachment_delete: function(e) {
e.preventDefault();
e.stopPropagation();
var self = this;
var $e = $(e.currentTarget);
var options = {
confirm_callback: function () {
new data.DataSet(this, 'ir.attachment')
.unlink([parseInt($e.attr('data-id'), 10)])
.done(function() {
self.do_attachement_update(self.dataset, self.model_id);
});
}
};
Dialog.confirm(this, _t("Do you really want to delete this attachment ?"), options);
}
});
self.$('.o_delete_exported_list').click(function() {
var select_exp = self.$('.o_exported_lists_select option:selected');
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);
});
});