[FIX] web: double click on save button was trying to save the data two times if there is some latency

bzr revid: dle@openerp.com-20140417101000-6gtyxntkm5d7zcoy
This commit is contained in:
Denis Ledoux 2014-04-17 12:10:00 +02:00
parent 7b93809fb4
commit f928ba4f10
1 changed files with 4 additions and 1 deletions

View File

@ -719,8 +719,9 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
}
}
},
on_button_save: function() {
on_button_save: function(e) {
var self = this;
$(e.delegateTarget).attr("disabled", true);
return this.save().done(function(result) {
self.trigger("save", result);
self.reload().then(function() {
@ -730,6 +731,8 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
parent.menu.do_reload_needaction();
}
});
}).always(function(){
$(e.delegateTarget).attr("disabled", false);
});
},
on_button_cancel: function(event) {