[IMP] google_calendar: move credentials from res_user table to a dedicated table

Before this commit, several token related data were stored on the res_users table. During event sync, the table could be locked and this commit aims to move these data to a dedicated table to avoid bottleneck effets.

Taskid: 2484335
Part-of: odoo/odoo#68700
This commit is contained in:
Arnaud Joset
2021-08-26 10:21:01 +00:00
parent 415d49f3f1
commit 24c2d7e9d6
5 changed files with 144 additions and 69 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ class GoogleAuth(http.Controller):
if kw.get('code'):
access_token, refresh_token, ttl = request.env['google.service']._get_google_tokens(kw['code'], service)
# LUL TODO only defined in google_calendar
request.env.user._set_auth_tokens(access_token, refresh_token, ttl)
request.env.user.google_cal_account_id._set_auth_tokens(access_token, refresh_token, ttl)
return request.redirect(url_return)
elif kw.get('error'):
return request.redirect("%s%s%s" % (url_return, "?error=", kw['error']))