[FIX] Crashmanager only display one error at a time, closing the previous one. (stupid fme)
bzr revid: fme@openerp.com-20111017152400-3ntwfzzxugkzrf0w
This commit is contained in:
@@ -136,21 +136,11 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog#
|
||||
}
|
||||
});
|
||||
|
||||
openerp.web.CrashManager = openerp.web.Dialog.extend(/** @lends openerp.web.CrashManager# */{
|
||||
identifier_prefix: 'dialog_crash',
|
||||
/**
|
||||
* @constructs opener.web.CrashManager
|
||||
* @extends openerp.web.Dialog
|
||||
*
|
||||
* @param parent
|
||||
*/
|
||||
openerp.web.CrashManager = openerp.web.SessionAware.extend({
|
||||
init: function(parent) {
|
||||
this._super(parent);
|
||||
this._super((parent || {}).session);
|
||||
this.session.on_rpc_error.add(this.on_rpc_error);
|
||||
},
|
||||
on_button_Ok: function() {
|
||||
this.close();
|
||||
},
|
||||
on_rpc_error: function(error) {
|
||||
this.error = error;
|
||||
if (error.data.fault_code) {
|
||||
@@ -161,20 +151,36 @@ openerp.web.CrashManager = openerp.web.Dialog.extend(/** @lends openerp.web.Cras
|
||||
}
|
||||
}
|
||||
if (error.code === 200 && error.type) {
|
||||
this.dialog_title = "OpenERP " + _.capitalize(error.type);
|
||||
this.template = 'DialogWarning';
|
||||
this.open({
|
||||
width: 'auto',
|
||||
height: 'auto'
|
||||
});
|
||||
this.on_managed_error(error);
|
||||
} else {
|
||||
this.dialog_title = "OpenERP Error";
|
||||
this.template = 'DialogTraceback';
|
||||
this.open({
|
||||
width: 'auto',
|
||||
height: 'auto'
|
||||
});
|
||||
this.on_traceback(error);
|
||||
}
|
||||
},
|
||||
on_managed_error: function(error) {
|
||||
$('<div>' + QWeb.render('DialogWarning', {error: error}) + '</div>').dialog({
|
||||
title: "OpenERP " + _.capitalize(error.type),
|
||||
buttons: {
|
||||
Ok: function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
on_traceback: function(error) {
|
||||
var dialog = new openerp.web.Dialog(this, {
|
||||
title: "OpenERP " + _.capitalize(error.type),
|
||||
autoOpen: true,
|
||||
width: '90%',
|
||||
height: '90%',
|
||||
min_width: '800px',
|
||||
min_height: '600px',
|
||||
buttons: {
|
||||
Ok: function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
dialog.$element.html(QWeb.render('DialogTraceback', {error: error}));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -946,7 +952,6 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
|
||||
this.session = new openerp.web.Session();
|
||||
this.loading = new openerp.web.Loading(this,"oe_loading");
|
||||
this.crashmanager = new openerp.web.CrashManager(this);
|
||||
this.crashmanager.start();
|
||||
|
||||
this.header = new openerp.web.Header(this);
|
||||
this.login = new openerp.web.Login(this);
|
||||
|
||||
Reference in New Issue
Block a user