You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1.1 KiB
28 lines
1.1 KiB
openerp.web_offline_warning = function(openerp) {
|
|
var _t = openerp.web._t;
|
|
var QWeb = openerp.web.qweb;
|
|
|
|
/**
|
|
* Handle general XmlHttpRequestErrors, which occur when the server cannot be reached.
|
|
*/
|
|
openerp.web.GenericXmlHttpRequestErrorHandler = openerp.web.Dialog.extend(openerp.web.ExceptionHandler, {
|
|
init: function(parent, error) {
|
|
this._super(parent);
|
|
this.error = error;
|
|
},
|
|
display: function() {
|
|
var self = this;
|
|
|
|
new openerp.web.Dialog(this, {
|
|
size: 'medium',
|
|
title: "Odoo " + _t("Warning"),
|
|
buttons: [
|
|
{text: _t("Ok"), click: function() { self.$el.parents('.modal').modal('hide'); self.destroy();}}
|
|
],
|
|
}, QWeb.render('CrashManager.warning',
|
|
{message: _t("The server cannot be reached. You are probably offline.")})
|
|
).open();
|
|
}
|
|
});
|
|
openerp.web.crash_manager_registry.add(void(0), 'openerp.web.GenericXmlHttpRequestErrorHandler');
|
|
}
|