[16.0][FIX]hr_timesheet_sheet_autodraft: fix department in timesheet sheet
When an employee requests some time-off, timesheet sheet is created if it doesn't exist, but sometimes department could be set wrong. By default, it's set with the same department of who approves time-off.
This is not correct, so my fix set department as the same of the employee who requested time-off.
These are the steps to reproduce the bug:
- Module
hr_timesheet_sheet_autodraftshould be active and Auto-draft Timesheet setting should be checked; - Assign department A to employee 1
- Assign department B to employee 2
- Make sure project and task are correctly set in the time-off type that will be used for the test;
- Employee 1 requests time-off;
- Employee 2 approves time-off;
On approval, a new timesheet will be created for employee 1 with the department of employee 2. With this fix, timesheet will be created with department of employee 1.
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.
@OCA/human-resources-maintainers Hi, this is a simple PR, could we ask for a review? We can FW once it's merged. Thanks!