[ADD] Ask for confirmation when copying records

[UPD] Update web_copy_confirm.pot

[ADD] icon.png
This commit is contained in:
Stefan Rijnhart
2018-01-26 12:35:53 +01:00
committed by Robin Conjour
parent 8f0767dcc0
commit fca241c9d5
7 changed files with 121 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
// Copyright (C) 2018 DynApps <http://www.dynapps.be>
// @author Stefan Rijnhart <stefan@opener.amsterdam>
// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
openerp.web_copy_confirm = function(instance) {
instance.web.FormView.include({
on_button_duplicate: function() {
var self = this;
this.has_been_loaded.done(function() {
if (confirm(_t("Do you really want to copy this record?"))) {
return self._super.apply(self, arguments);
}
});
}
});
};