diff --git a/addons/calendar/static/src/views/attendee_calendar/attendee_calendar_controller.js b/addons/calendar/static/src/views/attendee_calendar/attendee_calendar_controller.js index ea97dee6e90..cd3652d08e8 100644 --- a/addons/calendar/static/src/views/attendee_calendar/attendee_calendar_controller.js +++ b/addons/calendar/static/src/views/attendee_calendar/attendee_calendar_controller.js @@ -4,11 +4,12 @@ import { CalendarController } from "@web/views/calendar/calendar_controller"; import { useService } from "@web/core/utils/hooks"; export class AttendeeCalendarController extends CalendarController { - setup() { + async setup() { super.setup(); this.actionService = useService("action"); this.user = useService("user"); this.orm = useService("orm"); + this.isSystemUser = await this.user.hasGroup('base.group_system'); } onClickAddButton() { diff --git a/addons/calendar/static/src/views/attendee_calendar/attendee_calendar_controller.xml b/addons/calendar/static/src/views/attendee_calendar/attendee_calendar_controller.xml index ce655e77a92..2184962d6f8 100644 --- a/addons/calendar/static/src/views/attendee_calendar/attendee_calendar_controller.xml +++ b/addons/calendar/static/src/views/attendee_calendar/attendee_calendar_controller.xml @@ -2,19 +2,21 @@ -
- Synchronize with: -
-
-
- +
+
+ Synchronize with:
-
- +
+
+ +
+
+ +
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/google_calendar/static/src/views/google_calendar/google_calendar_controller.xml b/addons/google_calendar/static/src/views/google_calendar/google_calendar_controller.xml index f97a9334d1d..d3bb0b13e28 100644 --- a/addons/google_calendar/static/src/views/google_calendar/google_calendar_controller.xml +++ b/addons/google_calendar/static/src/views/google_calendar/google_calendar_controller.xml @@ -1,6 +1,9 @@ + + true +