diff --git a/addons/base/static/src/css/base.css b/addons/base/static/src/css/base.css index 30dc3718fa9..abf8431541a 100644 --- a/addons/base/static/src/css/base.css +++ b/addons/base/static/src/css/base.css @@ -1042,3 +1042,14 @@ background: linear-gradient(top, #ffffff 0%,#ebe9e9 100%); /* W3C */ .openerp .oe-m2o-disabled-cm { color: grey; } + +.openerp .oe-dialog-warning { + font-size: 1.2em; + font-weight: bold; +} +.openerp .oe-dialog-warning img { + float: left; + position: relative; + top: -0.5em; + margin:0 7px 7px 0; +} diff --git a/addons/base/static/src/js/chrome.js b/addons/base/static/src/js/chrome.js index 1b886b34ea8..2bea20fe972 100644 --- a/addons/base/static/src/js/chrome.js +++ b/addons/base/static/src/js/chrome.js @@ -819,24 +819,32 @@ openerp.base.Dialog = openerp.base.BaseWidget.extend({ } }); -openerp.base.CrashManager = openerp.base.Controller.extend({ - init: function(session, element_id) { - this._super(session, element_id); +openerp.base.CrashManager = openerp.base.Dialog.extend({ + identifier_prefix: 'dialog_crash', + init: function(session) { + this._super(session); this.session.on_rpc_error.add(this.on_rpc_error); }, - on_rpc_error: function(error) { - var msg = error.message + "\n" + error.data.debug; - this.display_error(msg); + on_button_Ok: function() { + this.close(); }, - display_error: function(message) { - $('
').text(message).dialog({ - modal: true, - buttons: { - OK: function() { - $(this).dialog("close"); - } - } - }); + on_rpc_error: function(error) { + this.error = error; + if (error.code === 200) { + this.dialog_title = "OpenERP Warning"; + this.template = 'DialogWarning'; + this.open({ + width: 'auto', + height: 'auto' + }); + } else { + this.dialog_title = "OpenERP Error"; + this.template = 'DialogTraceback'; + this.open({ + width: '80%', + height: '80%' + }); + } } }); @@ -1066,6 +1074,7 @@ openerp.base.WebClient = openerp.base.Controller.extend({ this.session = new openerp.base.Session("oe_errors"); this.loading = new openerp.base.Loading(this.session, "oe_loading"); this.crashmanager = new openerp.base.CrashManager(this.session); + this.crashmanager.start(false); // Do you autorize this ? openerp.base.Controller.prototype.notification = new openerp.base.Notification("oe_notification"); diff --git a/addons/base/static/src/xml/base.xml b/addons/base/static/src/xml/base.xml index 949b38e0115..2592abb5fdc 100644 --- a/addons/base/static/src/xml/base.xml +++ b/addons/base/static/src/xml/base.xml @@ -870,12 +870,15 @@
-
-
+
+
+