[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 <arj@odoo.com>
This commit is contained in:
Gabriel de Paula Felix (gdpf)
2023-02-06 10:18:45 +01:00
parent 7e6f7d943e
commit 75c6eda262
@@ -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() {