From 6227e4b5c04b9ee861511a45f7b50806e27cf33c Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 15 Nov 2012 13:03:31 +0100 Subject: [PATCH] [FIX] CrashManager do not have destroy() method bzr revid: chs@openerp.com-20121115120331-ltujwzobh19muygl --- addons/web/static/src/js/chrome.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 2753cb45d1e..f5fc7b8f632 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -190,7 +190,14 @@ instance.web.Dialog = instance.web.Widget.extend({ }); instance.web.CrashManager = instance.web.Class.extend({ + init: function() { + this.active = true; + }, + rpc_error: function(error) { + if (!this.active) { + return; + } if (error.data.fault_code) { var split = ("" + error.data.fault_code).split('\n')[0].split(' -- '); if (split.length > 1) { @@ -205,6 +212,9 @@ instance.web.CrashManager = instance.web.Class.extend({ } }, show_warning: function(error) { + if (!this.active) { + return; + } instance.web.dialog($('
' + QWeb.render('CrashManager.warning', {error: error}) + '
'), { title: "OpenERP " + _.str.capitalize(error.type), buttons: [ @@ -213,7 +223,9 @@ instance.web.CrashManager = instance.web.Class.extend({ }); }, show_error: function(error) { - var self = this; + if (!this.active) { + return; + } var buttons = {}; buttons[_t("Ok")] = function() { $(this).dialog("close"); @@ -642,7 +654,7 @@ instance.web.client_actions.add("login", "instance.web.Login"); instance.web.redirect = function(url, wait) { // Dont display a dialog if some xmlhttprequest are in progress if (instance.client && instance.client.crashmanager) { - instance.client.crashmanager.destroy(); + instance.client.crashmanager.active = false; } var wait_server = function() { @@ -658,7 +670,7 @@ instance.web.redirect = function(url, wait) { } else { window.location = url; } -} +}; /** * Client action to reload the whole interface.