diff options
| author | Fabien Meghazi <fme@openerp.com> | 2011-06-21 14:10:02 +0200 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2011-06-21 14:10:02 +0200 |
| commit | 8e20af033151e31aa33d2b751d8aaf9a59080855 (patch) | |
| tree | a48e482ba15f3bc29a68abe709ee5610b0968255 /addons/base/static/src | |
| parent | 41716a15161f35368111e34f1fb4afb19645219a (diff) | |
[IMP] Improved CrashManager
bzr revid: fme@openerp.com-20110621121002-bqcsuzdfncyb1v24
Diffstat (limited to 'addons/base/static/src')
| -rw-r--r-- | addons/base/static/src/css/base.css | 11 | ||||
| -rw-r--r-- | addons/base/static/src/js/chrome.js | 39 | ||||
| -rw-r--r-- | addons/base/static/src/xml/base.xml | 15 |
3 files changed, 44 insertions, 21 deletions
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) { - $('<pre></pre>').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 @@ </div> </t> <t t-name="DialogWarning"> - <div id="dialog-message" t-att-title="title"> - <p> - <span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span> - <t t-esc="message"/> - </p> - </div> + <p class="oe-dialog-warning"> + <img src="/base/static/src/img/warning.png" class="oe-dialog-icon"/> + <t t-esc="error.data.fault_code.substr(18)"/> + </p> +</t> +<t t-name="DialogTraceback"> + <pre><t t-esc="error.message"/></pre> + <hr/> + <pre><t t-esc="error.data.debug"/></pre> </t> <t t-name="SelectCreatePopup"> <div t-att-id="element_id"> |
