From bc1abc5582e2752926b4b5bd4e315cb3085bb76b Mon Sep 17 00:00:00 2001 From: Philippe Wauthy Date: Tue, 19 Oct 2021 10:09:30 +0000 Subject: [PATCH] [FIX] hr_holidays: delete holidays in correct states On the month, week or day time off calendar views, the delete button appears when the time off is in approved or refused state and does not when the time off is in other states. The behavior should be the opposite. https://www.awesomescreenshot.com/video/5681852?key=2b2136139c3fadd1006b98c0f4be920c task-2671598 closes odoo/odoo#78614 Signed-off-by: Kevin Baptiste --- .../src/js/time_off_calendar/time_off_calendar_popover.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/static/src/js/time_off_calendar/time_off_calendar_popover.js b/addons/hr_holidays/static/src/js/time_off_calendar/time_off_calendar_popover.js index 89d4082f8a3..41dec8b7a11 100644 --- a/addons/hr_holidays/static/src/js/time_off_calendar/time_off_calendar_popover.js +++ b/addons/hr_holidays/static/src/js/time_off_calendar/time_off_calendar_popover.js @@ -9,7 +9,7 @@ export const TimeOffCalendarPopover = CalendarPopover.extend({ init(parent, eventInfo) { this._super(...arguments); const state = this.event.extendedProps.record.state; - this.canDelete = state && ['validate', 'refuse'].includes(state); + this.canDelete = state && !['validate', 'refuse'].includes(state); this.canEdit = state !== undefined; this.displayFields = [];