summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorBhumi Thakkar (Open ERP) <bth@tinyerp.com>2013-02-18 17:52:23 +0530
committerBhumi Thakkar (Open ERP) <bth@tinyerp.com>2013-02-18 17:52:23 +0530
commit0870ff76a1ff2396a606d7fbfbe7ac1b2bbf8c80 (patch)
tree1ec8c39d60d8766e1021e33438b010fe089576e3 /addons/web/static/src
parentf6629dfbbd497c544fcf02b43186f2d28d4ac926 (diff)
parent4d242424cd13ade53498c12ed0a90975b1e0c864 (diff)
[MERGE] Merge lp:openerp-web.
bzr revid: bth@tinyerp.com-20130218122223-reyc4zsyslxd2uec
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/chrome.js28
1 files changed, 28 insertions, 0 deletions
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($('<div>' + QWeb.render('CrashManager.warning', {error: error}) + '</div>'), {
+ 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) {