Skip to content
Snippets Groups Projects
Commit 6048902d authored by std-odoo's avatar std-odoo
Browse files

[FIX] google_gmail: do not copy the authorization code

Bug
===
When we copy a GMail outgoing / incoming mail server, an error
occurs because we try to refetch the access token, based on the same
authorization code (which can be used only once).

To fix this issue, we do not copy the authorization code (and other
related fields).

Task-2751996

X-original-commit: 2879976160bc0777cde1368ed2b69ce821c85ff1
Part-of: odoo/odoo#87498
parent ff27b67b
No related branches found
No related tags found
No related merge requests found
......@@ -17,10 +17,10 @@ class GoogleGmailMixin(models.AbstractModel):
_SERVICE_SCOPE = 'https://mail.google.com/'
use_google_gmail_service = fields.Boolean('Gmail Authentication')
google_gmail_authorization_code = fields.Char(string='Authorization Code', groups='base.group_system')
google_gmail_refresh_token = fields.Char(string='Refresh Token', groups='base.group_system')
google_gmail_access_token = fields.Char(string='Access Token', groups='base.group_system')
google_gmail_access_token_expiration = fields.Integer(string='Access Token Expiration Timestamp', groups='base.group_system')
google_gmail_authorization_code = fields.Char(string='Authorization Code', groups='base.group_system', copy=False)
google_gmail_refresh_token = fields.Char(string='Refresh Token', groups='base.group_system', copy=False)
google_gmail_access_token = fields.Char(string='Access Token', groups='base.group_system', copy=False)
google_gmail_access_token_expiration = fields.Integer(string='Access Token Expiration Timestamp', groups='base.group_system', copy=False)
google_gmail_uri = fields.Char(compute='_compute_gmail_uri', string='URI', help='The URL to generate the authorization code from Google', groups='base.group_system')
@api.depends('google_gmail_authorization_code')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment