diff options
| author | Lucas Lefèvre <lul@odoo.com> | 2019-04-18 08:30:22 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2019-04-24 12:24:13 +0000 |
| commit | d6242a340d5cadd0440215183f9826cf533f5164 (patch) | |
| tree | 84a68633b86d323a864a4c739a6311a83869c2c7 /addons/base_setup/data/base_setup_data.xml | |
| parent | 17ac11d5aae1249be25de93a6beb07f4ed5cea6b (diff) | |
[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.
Diffstat (limited to 'addons/base_setup/data/base_setup_data.xml')
0 files changed, 0 insertions, 0 deletions
