19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:28 +01:00
parent 20ddc1b4a3
commit c0efcc53f5
1162 changed files with 125577 additions and 105287 deletions

View file

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
@ -7,7 +6,7 @@ from odoo.addons.google_calendar.models.google_sync import google_calendar_token
from odoo.addons.google_calendar.utils.google_calendar import GoogleCalendarService
class ResetGoogleAccount(models.TransientModel):
class GoogleCalendarAccountReset(models.TransientModel):
_name = 'google.calendar.account.reset'
_description = 'Google Calendar Account Reset'
@ -42,8 +41,9 @@ class ResetGoogleAccount(models.TransientModel):
# Delete events according to the selected policy. If the deletion is only in
# Google, we won't keep track of the 'google_id' field for events and recurrences.
if self.delete_policy in ('delete_odoo', 'delete_both', 'delete_google'):
events.google_id = False
recurrences.google_id = False
# Flag need_sync as False in order to skip the write permission when resetting.
events.with_context(skip_event_permission=True).google_id = False
recurrences.with_context(skip_event_permission=True).google_id = False
if self.delete_policy != 'delete_google':
events.unlink()
@ -58,9 +58,9 @@ class ResetGoogleAccount(models.TransientModel):
# Write the next sync update attribute on the existing events.
if self.delete_policy not in ('delete_odoo', 'delete_both'):
events.write(next_sync_update)
events.with_context(skip_event_permission=True).write(next_sync_update)
self.user_id.google_calendar_account_id._set_auth_tokens(False, False, 0)
self.user_id.res_users_settings_id._set_google_auth_tokens(False, False, 0)
self.user_id.write({
'google_calendar_sync_token': False,
'google_calendar_cal_id': False,