[FIX] web: double click on save button was trying to save the data two times if there is some latency, event target should be used instead of delegate target

bzr revid: dle@openerp.com-20140417101217-3fwnm76qne6f1vwk
This commit is contained in:
Denis Ledoux 2014-04-17 12:12:17 +02:00
parent f928ba4f10
commit 7c668d8eac
1 changed files with 2 additions and 2 deletions

View File

@ -721,7 +721,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
}, },
on_button_save: function(e) { on_button_save: function(e) {
var self = this; var self = this;
$(e.delegateTarget).attr("disabled", true); $(e.target).attr("disabled", true);
return this.save().done(function(result) { return this.save().done(function(result) {
self.trigger("save", result); self.trigger("save", result);
self.reload().then(function() { self.reload().then(function() {
@ -732,7 +732,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
} }
}); });
}).always(function(){ }).always(function(){
$(e.delegateTarget).attr("disabled", false); $(e.target).attr("disabled", false);
}); });
}, },
on_button_cancel: function(event) { on_button_cancel: function(event) {