lp bug: https://launchpad.net/bugs/1093671 fixed
bzr revid: nicolas.vanhoren@openerp.com-
20130108164104-7wv2yxlrczqmicvb
class AuthenticationError(Exception):
pass
+class SessionExpiredException(Exception):
+ pass
+
class Service(object):
def __init__(self, session, service_name):
self.session = session
:type model: str
:rtype: a model object
"""
+ if self._db == False:
+ raise SessionExpiredException("Session expired")
return Model(self, model)
if (!this.active) {
return;
}
+ // yes, exception handling is shitty
+ if (error.code === 300 && error.data && error.data.type == "client_exception" && error.data.debug.match("SessionExpiredException")) {
+ this.show_warning({type: "Session Expired", data: { fault_code: "Your OpenERP session expired. Please refresh the current web page." }});
+ return;
+ }
if (error.data.fault_code) {
var split = ("" + error.data.fault_code).split('\n')[0].split(' -- ');
if (split.length > 1) {