[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 <kba@odoo.com>
This commit is contained in:
Philippe Wauthy
2021-10-19 13:17:31 +00:00
parent d52eebd6ca
commit bc1abc5582
@@ -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 = [];