[IMP] Improved CrashManager

bzr revid: fme@openerp.com-20110622145757-52ffxs6cj8m0jpnb
This commit is contained in:
Fabien Meghazi
2011-06-22 16:57:57 +02:00
parent 58291d4ab6
commit cbf9300f23
3 changed files with 24 additions and 14 deletions
+2 -7
View File
@@ -1060,13 +1060,8 @@ background: linear-gradient(top, #ffffff 0%,#ebe9e9 100%); /* W3C */
color: grey;
}
.openerp .oe-dialog-warning {
.openerp .oe-dialog-warning p {
padding-left: 1em;
font-size: 1.2em;
font-weight: bold;
}
.openerp .oe-dialog-warning img {
float: left;
position: relative;
top: -0.5em;
margin:0 7px 7px 0;
}
+9 -3
View File
@@ -399,7 +399,6 @@ openerp.base.Session = openerp.base.BasicController.extend( /** @lends openerp.b
on_rpc_response: function() {
},
on_rpc_error: function(error) {
this.on_log(error.message, error.data.debug);
},
/**
* The session is validated either by login or by restoration of a previous session
@@ -830,8 +829,15 @@ openerp.base.CrashManager = openerp.base.Dialog.extend({
},
on_rpc_error: function(error) {
this.error = error;
if (error.code === 200) {
this.dialog_title = "OpenERP Warning";
if (error.data.fault_code) {
var split = error.data.fault_code.split('\n')[0].split(' -- ');
if (split.length > 1) {
error.type = split.shift();
error.data.fault_code = error.data.fault_code.substr(error.type.length + 4);
}
}
if (error.code === 200 && error.type) {
this.dialog_title = "OpenERP " + _.capitalize(error.type);
this.template = 'DialogWarning';
this.open({
width: 'auto',
+13 -4
View File
@@ -871,10 +871,19 @@
</div>
</t>
<t t-name="DialogWarning">
<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>
<table cellspacing="0" cellpadding="0" border="0" class="oe-dialog-warning">
<tr>
<td><img src="/base/static/src/img/warning.png" class="oe-dialog-icon"/></td>
<td>
<p>
<t t-js="d">
d.html_error = context.engine.tools.html_escape(d.error.data.fault_code).replace(/\n/g, '<br/>');
</t>
<t t-raw="html_error"/>
</p>
</td>
</tr>
</table>
</t>
<t t-name="DialogTraceback">
<pre><t t-esc="error.message"/></pre>