[FIX] web: dialog close with a reason

In the below revision:
c0db6aec56

The dialog close `reason` was introduced
to not reload the current form if the dialog
has been closed for a reason
(e.g. a window action was returned by the server).

This is to prevent the record reload, which:
 - Is useless, as another action has been launched
   and the user therefore redirected elsewhere
 - Can fail, in the case the initial action deleted
   the current record
   (e.g. when merging a lead in an opportunity, the
   lead is removed, and therefore this is not possible to reload
   it).

 opw-680180
This commit is contained in:
Denis Ledoux
2016-07-04 18:40:15 +02:00
parent faf3577896
commit 6c85d925c3
+2 -2
View File
@@ -124,11 +124,11 @@ var Dialog = Widget.extend({
this.$modal.modal('hide');
},
destroy: function() {
destroy: function(reason) {
if(this.isDestroyed())
return;
this.trigger("closed");
this.trigger("closed", reason);
this._super();