From e4030e2016d23f4864519698548798fd0ca967b4 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Mon, 16 Feb 2015 14:54:52 +0100 Subject: [PATCH] [FIX] google_calendar: write info on current user with superuser_id If the user is not admin, it will synchronize always from start, because last_synchro_date cannot be write on res_users --- addons/google_calendar/google_calendar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/google_calendar/google_calendar.py b/addons/google_calendar/google_calendar.py index 03bd7335914..1b0dbf433cc 100644 --- a/addons/google_calendar/google_calendar.py +++ b/addons/google_calendar/google_calendar.py @@ -296,7 +296,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_token': False, 'google_calendar_token_validity': False}, context=context) + self.pool['res.users'].write(cur, SUPERUSER_ID, [uid], {'google_calendar_token': False, 'google_calendar_token_validity': False}, context=context) raise self.pool.get('res.config.settings').get_config_warning(cr, _(error_msg), context=context) raise @@ -698,7 +698,7 @@ class google_calendar(osv.AbstractModel): cr.rollback() 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) + self.pool['res.users'].write(cur, SUPERUSER_ID, [uid], {'google_calendar_last_sync_date': False}, context=context) error_key = simplejson.loads(str(e)) error_key = error_key.get('error', {}).get('message', 'nc') error_msg = "Google is lost... the next synchro will be a full synchro. \n\n %s" % error_key