mirror of
https://github.com/bringout/oca-ocb-security.git
synced 2026-04-23 21:42:09 +02:00
19.0 vanilla
This commit is contained in:
parent
20ddc1b4a3
commit
c0efcc53f5
1162 changed files with 125577 additions and 105287 deletions
|
|
@ -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
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue