From 7517487770ccd2322c53ede0c2bd80d03aa43d4a Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 27 Apr 2021 14:28:17 +0000 Subject: [PATCH] [FIX] microsoft_calendar: permanent event no traceback on open When synchronizing microsoft calendar events, if the event is permanent Microsoft says the endDate is "0001-01-01": we save that and this causes an error when it is being parsed in javascript since we require a date with higher than 1000 years in require('web.field_utils').parseDate function. With this changeset, we do not set endDate if the type of the event is not endDate (as shown[^1] in the documentation endDate only makes sense for event of type endDate). [^1]: https://docs.microsoft.com/en-us/graph/outlook-schedule-recurring-events#recurrence-ranges opw-2479029 fixes #69481 closes #69944 closes odoo/odoo#70009 X-original-commit: 7aa233e63a8c82cce8336adb99418a96e061268f Signed-off-by: Nicolas Lempereur (nle) --- addons/microsoft_calendar/utils/microsoft_event.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/microsoft_calendar/utils/microsoft_event.py b/addons/microsoft_calendar/utils/microsoft_event.py index c21e3484e6e..7f13a3d03de 100644 --- a/addons/microsoft_calendar/utils/microsoft_event.py +++ b/addons/microsoft_calendar/utils/microsoft_event.py @@ -178,7 +178,7 @@ class MicrosoftEvent(abc.Set): 'count': range['numberOfOccurrences'], 'day': pattern['dayOfMonth'], 'byday': index_dict.get(pattern['index'], False), - 'until': range['endDate'], + 'until': range['type'] == 'endDate' and range['endDate'], } month_by_dict = {