diff --git a/addons/google_calendar/static/src/views/google_calendar/google_calendar_controller.js b/addons/google_calendar/static/src/views/google_calendar/google_calendar_controller.js index 601a1c2aed3..407a6b25315 100644 --- a/addons/google_calendar/static/src/views/google_calendar/google_calendar_controller.js +++ b/addons/google_calendar/static/src/views/google_calendar/google_calendar_controller.js @@ -19,15 +19,17 @@ patch(AttendeeCalendarController.prototype, "google_calendar_google_calendar_con [[this.user.userId]], ); const syncResult = await this.model.syncGoogleCalendar(); - if (syncResult.status === "need_auth") { - this.configureCalendarProviderSync("google"); - } else if (syncResult.status === "need_config_from_admin") { - if (Number.isInteger(syncResult.action)) { - this.dialog.add(ConfirmationDialog, { - title: this.env._t("Configuration"), - body: this.env._t("The Google Synchronization needs to be configured before you can use it, do you want to do it now?"), - confirm: this.actionService.doAction.bind(this.actionService, syncResult.action), - }); + if (["need_auth", "need_config_from_admin"].includes(syncResult.status)) { + if (this.isSystemUser) { + if (syncResult.status === "need_auth") { + this.configureCalendarProviderSync("google"); + } else if (syncResult.status === "need_config_from_admin") { + this.dialog.add(ConfirmationDialog, { + title: this.env._t("Configuration"), + body: this.env._t("The Google Synchronization needs to be configured before you can use it, do you want to do it now?"), + confirm: this.actionService.doAction.bind(this.actionService, syncResult.action), + }); + } } else { this.dialog.add(AlertDialog, { title: this.env._t("Configuration"), diff --git a/addons/microsoft_calendar/static/src/views/microsoft_calendar/microsoft_calendar_controller.js b/addons/microsoft_calendar/static/src/views/microsoft_calendar/microsoft_calendar_controller.js index 59dd7494946..39bd5e77e1a 100644 --- a/addons/microsoft_calendar/static/src/views/microsoft_calendar/microsoft_calendar_controller.js +++ b/addons/microsoft_calendar/static/src/views/microsoft_calendar/microsoft_calendar_controller.js @@ -19,15 +19,17 @@ patch(AttendeeCalendarController.prototype, "microsoft_calendar_microsoft_calend [[this.user.userId]], ); const syncResult = await this.model.syncMicrosoftCalendar(); - if (syncResult.status === "need_auth") { - this.configureCalendarProviderSync("microsoft"); - } else if (syncResult.status === "need_config_from_admin") { - if (Number.isInteger(syncResult.action)) { - this.dialog.add(ConfirmationDialog, { - title: this.env._t("Configuration"), - body: this.env._t("The Outlook Synchronization needs to be configured before you can use it, do you want to do it now?"), - confirm: this.actionService.doAction.bind(this.actionService, syncResult.action), - }); + if (["need_auth", "need_config_from_admin"].includes(syncResult.status)) { + if (this.isSystemUser) { + if (syncResult.status === "need_auth") { + this.configureCalendarProviderSync("microsoft"); + } else if (syncResult.status === "need_config_from_admin") { + this.dialog.add(ConfirmationDialog, { + title: this.env._t("Configuration"), + body: this.env._t("The Outlook Synchronization needs to be configured before you can use it, do you want to do it now?"), + confirm: this.actionService.doAction.bind(this.actionService, syncResult.action), + }); + } } else { this.dialog.add(AlertDialog, { title: this.env._t("Configuration"),