[FIX] google_calendar: All exceptions types do not have read method

This commit is contained in:
Denis Ledoux 2014-12-10 17:29:14 +01:00
parent db98d0771a
commit ebca88defc
1 changed files with 1 additions and 1 deletions

View File

@ -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)