timesheet icon indicating copy to clipboard operation
timesheet copied to clipboard

[16.0][FIX]hr_timesheet_sheet_autodraft: fix department in timesheet sheet

Open quirino95 opened this issue 6 months ago • 2 comments

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:

  1. Module hr_timesheet_sheet_autodraft should be active and Auto-draft Timesheet setting should be checked;
  2. Assign department A to employee 1
  3. Assign department B to employee 2
  4. Make sure project and task are correctly set in the time-off type that will be used for the test;
  5. Employee 1 requests time-off;
  6. 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.

quirino95 avatar Jun 06 '25 07:06 quirino95

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.

github-actions[bot] avatar Oct 05 '25 12:10 github-actions[bot]

@OCA/human-resources-maintainers Hi, this is a simple PR, could we ask for a review? We can FW once it's merged. Thanks!

aleuffre avatar Oct 06 '25 08:10 aleuffre