diff --git a/addons/hr_holidays/static/src/views/calendar/calendar_controller.js b/addons/hr_holidays/static/src/views/calendar/calendar_controller.js index ab73f35a2cb..cadee330e46 100644 --- a/addons/hr_holidays/static/src/views/calendar/calendar_controller.js +++ b/addons/hr_holidays/static/src/views/calendar/calendar_controller.js @@ -78,18 +78,18 @@ export class TimeOffCalendarController extends CalendarController { } deleteRecord(record) { - if (!record.can_cancel) { + if (!record.data.can_cancel) { this.displayDialog(ConfirmationDialog, { title: _t("Confirmation"), body: _t("Are you sure you want to delete this record?"), confirm: async () => { - await this.model.unlinkRecord(record.id); + await this.model.unlinkRecord(record.resId); this.env.timeOffBus.trigger('update_dashboard'); }, cancel: () => {}, }); } else { - this.leaveCancelWizard(record.id, () => { + this.leaveCancelWizard(record.resId, () => { this.model.load(); this.env.timeOffBus.trigger('update_dashboard'); }); @@ -125,5 +125,6 @@ TimeOffCalendarController.components = { Dropdown, DropdownItem, FilterPanel: TimeOffCalendarFilterPanel, -} -TimeOffCalendarController.template = "hr_holidays.CalendarController" \ No newline at end of file +}; + +TimeOffCalendarController.template = "hr_holidays.CalendarController"; diff --git a/addons/hr_holidays/static/src/views/view_dialog/form_view_dialog.js b/addons/hr_holidays/static/src/views/view_dialog/form_view_dialog.js index a6a8ade711d..ea9101d58bc 100644 --- a/addons/hr_holidays/static/src/views/view_dialog/form_view_dialog.js +++ b/addons/hr_holidays/static/src/views/view_dialog/form_view_dialog.js @@ -40,7 +40,7 @@ export class TimeOffDialogFormController extends FormController { } deleteRecord() { - this.props.onRecordDeleted(this.record.data) + this.props.onRecordDeleted(this.record); this.props.onCancelLeave(); if (this.record.data.can_cancel) { this.leaveCancelWizard(this.record.resId, () => {