From 75c6eda262fa8c7fc52ebd14c6cf5f559016ff51 Mon Sep 17 00:00:00 2001 From: "Gabriel de Paula Felix (gdpf)" Date: Mon, 23 Jan 2023 18:15:57 +0000 Subject: [PATCH] [IMP] calendar: remove rpc from setup Removing the async header from the setup() function because this function is not entirely async, and inserting it alongside an onWillStart hook to be awaited before rendering the component. closes odoo/odoo#111831 Task: 3141281 X-original-commit: 295f04b3496763cfef5237ff4b1f40df232371a7 Signed-off-by: Arnaud Joset --- .../attendee_calendar/attendee_calendar_controller.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 cd3652d08e8..c5c06619c25 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 @@ -2,14 +2,17 @@ import { CalendarController } from "@web/views/calendar/calendar_controller"; import { useService } from "@web/core/utils/hooks"; +import { onWillStart } from "@odoo/owl"; export class AttendeeCalendarController extends CalendarController { - async setup() { + setup() { super.setup(); this.actionService = useService("action"); this.user = useService("user"); this.orm = useService("orm"); - this.isSystemUser = await this.user.hasGroup('base.group_system'); + onWillStart(async () => { + this.isSystemUser = await this.user.hasGroup('base.group_system'); + }); } onClickAddButton() {