From 2cf1f7a7a6312066a8007eca53fe05039e416cf3 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 5 Sep 2012 17:20:30 +0200 Subject: [PATCH] [ADD] Added dirty form notification on on_logout bzr revid: fme@openerp.com-20120905152030-qfrkrwg4k1srxtix --- addons/web/static/src/js/chrome.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 3180c21f88e..21b0c050365 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1049,11 +1049,15 @@ instance.web.WebClient = instance.web.Client.extend({ }, on_logout: function() { var self = this; - this.session.session_logout().then(function () { - $(window).unbind('hashchange', self.on_hashchange); - self.do_push_state({}); - window.location.reload(); - }); + var $e = $.Event("about_to_destroy"); + this.action_manager.inner_widget.trigger("about_to_destroy", $e); + if (!$e.isDefaultPrevented()) { + this.session.session_logout().then(function () { + $(window).unbind('hashchange', self.on_hashchange); + self.do_push_state({}); + window.location.reload(); + }); + } }, bind_hashchange: function() { var self = this;