Before this commit, when the first synchronization with Outlook Calendar was done or when the synchronization was restarted, all events previously created in Odoo (before synchronizing) were being synced with Outlook, triggering lots of emails and notifications for attendees. Additionaly, all microsoft credentials information were concentrated within the res_users file, difficulting updates in this file. After this commit, only events created or updated after the synchronization starts (or restarts) are synced with Outlook Calendar, with 5 minutes of time acceptance for avoiding network delay issues. Moreover, a Microsoft Credentials module was added for gathering microsoft credentials in one place. closes odoo/odoo#128150 Task-id: 3410651 Related: odoo/upgrade#5047 Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
17 lines
658 B
Python
17 lines
658 B
Python
import logging
|
|
|
|
from odoo import fields, models
|
|
|
|
_logger = logging.getLogger(__name__)
|
|
|
|
class MicrosoftCredentials(models.Model):
|
|
""""Microsoft Account of res_users"""
|
|
|
|
_name = 'microsoft.calendar.credentials'
|
|
_description = 'Microsoft Calendar Account Data'
|
|
|
|
user_ids = fields.One2many('res.users', 'microsoft_calendar_account_id', required=True)
|
|
calendar_sync_token = fields.Char('Microsoft Next Sync Token', copy=False)
|
|
synchronization_stopped = fields.Boolean('Outlook Synchronization stopped', copy=False)
|
|
last_sync_date = fields.Datetime('Last Sync Date', copy=False, help='Last synchronization date with Outlook Calendar')
|