From 1bcc41f7fe3d197f1b69bb5073869c8dbbcb09d1 Mon Sep 17 00:00:00 2001 From: "Gabriel de Paula Felix (gdpf)" Date: Fri, 3 Nov 2023 10:51:37 +0000 Subject: [PATCH] [FIX] microsoft_calendar: validation error creating events from microsoft Before this commit, for some synced users, a weird behavior was happening when an event was created in Microsoft: the event info was being sent to Odoo with a different organizer than 'self.env.user' even though it was the same user creating the event. After this commit, a condition checking if the event was created in Microsoft is added for skipping the checking since only events created in Odoo can have different organizers during their creation. Issue from: 3450045 closes odoo/odoo#141481 X-original-commit: 176ca9789b0c2e032773f3ba2c72ab7e2ed24d91 Signed-off-by: Arnaud Joset (arj) Signed-off-by: Gabriel de Paula Felix (gdpf) --- addons/microsoft_calendar/models/microsoft_sync.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/microsoft_calendar/models/microsoft_sync.py b/addons/microsoft_calendar/models/microsoft_sync.py index 198e0978ac8..a23adb07350 100644 --- a/addons/microsoft_calendar/models/microsoft_sync.py +++ b/addons/microsoft_calendar/models/microsoft_sync.py @@ -415,7 +415,7 @@ class MicrosoftSync(models.AbstractModel): if token: self._ensure_attendees_have_email() res = microsoft_service.patch(event_id, values, token=token, timeout=timeout) - self.write({ + self.with_context(dont_notify=True).write({ 'need_sync_m': not res, })