diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 1407df4d33f..86d0a20ed20 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -327,6 +327,34 @@ instance.web.ExceptionHandler = { */ instance.web.crash_manager_registry = new instance.web.Registry(); +/** + * Handle redirection warnings, which behave more or less like a regular + * warning, with an additional redirection button. + */ +instance.web.RedirectWarningHandler = instance.web.Dialog.extend(instance.web.ExceptionHandler, { + init: function(parent, error) { + this._super(parent); + this.error = error; + }, + display: function() { + error = this.error; + error.data.message = error.data.arguments[0]; + + instance.web.dialog($('
' + QWeb.render('CrashManager.warning', {error: error}) + '
'), { + title: "OpenERP " + (_.str.capitalize(error.type) || "Warning"), + buttons: [ + {text: _t("Ok"), click: function() { $(this).dialog("close"); }}, + {text: error.data.arguments[2], click: function() { + window.location.href='#action='+error.data.arguments[1]; + $(this).dialog("close"); + }} + ] + }); + this.destroy(); + } +}); +instance.web.crash_manager_registry.add('openerp.exceptions.RedirectWarning', 'instance.web.RedirectWarningHandler'); + instance.web.Loading = instance.web.Widget.extend({ template: _t("Loading"), init: function(parent) { diff --git a/addons/web_kanban/i18n/da.po b/addons/web_kanban/i18n/da.po index 69339d9a1c4..0fa4a479ef1 100644 --- a/addons/web_kanban/i18n/da.po +++ b/addons/web_kanban/i18n/da.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-02-15 04:49+0000\n" +"X-Launchpad-Export-Date: 2013-02-16 05:09+0000\n" "X-Generator: Launchpad (build 16491)\n" #. module: web_kanban