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
@ -6,7 +5,7 @@ from odoo import fields, models
from odoo.addons.microsoft_calendar.models.microsoft_sync import microsoft_calendar_token
class ResetMicrosoftAccount(models.TransientModel):
class MicrosoftCalendarAccountReset(models.TransientModel):
_name = 'microsoft.calendar.account.reset'
_description = 'Microsoft Calendar Account Reset'
@ -35,7 +34,7 @@ class ResetMicrosoftAccount(models.TransientModel):
if self.delete_policy in ('delete_microsoft', 'delete_both'):
for event in non_recurring_events:
event._microsoft_delete(event._get_organizer(), event.ms_organizer_event_id, timeout=3)
event._microsoft_delete(event._get_organizer(), event.microsoft_id, timeout=3)
if self.sync_policy == 'all':
events.with_context(dont_notify=True).update({
@ -50,6 +49,7 @@ class ResetMicrosoftAccount(models.TransientModel):
# We commit to make sure the _microsoft_delete are called when we still have a token on the user.
self.env.cr.commit()
self.user_id._set_microsoft_auth_tokens(False, False, 0)
self.user_id.write({
self.user_id.res_users_settings_id.write({
'microsoft_calendar_sync_token': False,
'microsoft_last_sync_date': False
})