From 6c85d925c310fbbcd5b5f374932440b2e6482e37 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 4 Jul 2016 18:36:27 +0200 Subject: [PATCH] [FIX] web: dialog close with a reason In the below revision: c0db6aec56d383d173fa56b1a2dec2e42495911b 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 --- addons/web/static/src/js/framework/dialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/framework/dialog.js b/addons/web/static/src/js/framework/dialog.js index cd4540af270..b39cae3c3a5 100644 --- a/addons/web/static/src/js/framework/dialog.js +++ b/addons/web/static/src/js/framework/dialog.js @@ -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();