[FIX] google_calendar: browse user as SUPERUSER_ID to be able to write/update google_...
authorJeremy Kersten <jke@odoo.com>
Wed, 24 Sep 2014 12:53:46 +0000 (14:53 +0200)
committerJeremy Kersten <jke@odoo.com>
Wed, 24 Sep 2014 12:53:46 +0000 (14:53 +0200)
addons/google_calendar/google_calendar.py

index 7df4fa3..b4483f9 100644 (file)
@@ -482,7 +482,7 @@ class google_calendar(osv.AbstractModel):
         return res
 
     def remove_references(self, cr, uid, context=None):
-        current_user = self.pool['res.users'].browse(cr, uid, uid, context=context)
+        current_user = self.pool['res.users'].browse(cr, SUPERUSER_ID, uid, context=context)
         reset_data = {
             'google_calendar_rtoken': False,
             'google_calendar_token': False,
@@ -512,7 +512,7 @@ class google_calendar(osv.AbstractModel):
         #     status, response = gs_pool._do_request(cr, uid, url, params, type='GET', context=context)
         #     return int(status) != 410
 
-        current_user = self.pool['res.users'].browse(cr, uid, uid, context=context)
+        current_user = self.pool['res.users'].browse(cr, SUPERUSER_ID, uid, context=context)
 
         st, current_google, ask_time = self.get_calendar_primary_id(cr, uid, context=context)