[FIX] google_calendar: All exceptions types do not have read method
This commit is contained in:
parent
db98d0771a
commit
ebca88defc
|
@ -667,7 +667,7 @@ class google_calendar(osv.AbstractModel):
|
|||
registry = openerp.modules.registry.RegistryManager.get(request.session.db)
|
||||
with registry.cursor() as cur:
|
||||
self.pool['res.users'].write(cur, uid, [uid], {'google_calendar_last_sync_date': False}, context=context)
|
||||
error_key = simplejson.loads(e.read())
|
||||
error_key = simplejson.loads(str(e))
|
||||
error_key = error_key.get('error', {}).get('message', 'nc')
|
||||
error_msg = "Google are lost... the next synchro will be a full synchro. \n\n %s" % error_key
|
||||
raise self.pool.get('res.config.settings').get_config_warning(cr, _(error_msg), context=context)
|
||||
|
|
Loading…
Reference in New Issue