-
- Downloads
[FIX] hr_holidays: Allow create department leave
1. Open form view to create a leave 2. Change the leave type to 'By department' 3. Choose the department of the current user 4. Save the leave 5. Approve the leave => ValidationError, cannot have two leaves at the same time. In `@api.onchange('holiday_type')`, when choosing by department it sets `employee_id`, `mode_company_id` and `category_id` to `False` ONLY if the department is not already set. But by default, the employee is set to the user's employee and the department is set to the employee's department. Therefore the employee is never set to `False` and the department leave is linked to this employee. When validating the 'department' leave, an 'employee' leave is created for each employee in the department. For the current user, it crashes because the deparment leave overlaps with the 'employee' leave since the department leave is linked to the employee.
Loading
Please register or sign in to comment