Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX]hr_employee_calendar_planning:incorrect hours_per_day #1436

Draft
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

ChristophAbenthungCibex
Copy link
Contributor

Always using the topmost hr.employee.calendar for hours_per_day may lead to unexpected and incorrect behavior. For example if the date_start and date_end of the topmost calendar are in the future. Then the hours_per_day from the future calendar are taken not from the currently used one. The more specific calendars in regard of date_start and date_end are considered earlier than the less specific ones.
Additionally, added a scheduled action to keep hours_per_day up to date.

How to recreate the problem:

  1. Go to Employee and add a hr.employee.calendar
  2. Set the date_start for yesterday and end_date for tomorrow
  3. Select any resource.calendar
  4. Add another hr.employee.calendar
  5. Set date_start to the day after tomorrow
  6. Select any other resource.calendar
  7. Go to the auto generated calendar of that employee
    The hours_per_day are set to the value of the topmost resource.calendar. That calendar should not be used currently. This can lead to incorrect behavior. For example for incorrect calculations of time offs.

@OCA-git-bot
Copy link
Contributor

Hi @victoralmau, @pedrobaeza,
some modules you are maintaining are being modified, check this out!

Always using the topmost hr.employee.calendar for hours per day may lead to unexpected and incorrect behaviour. For example if the date_start and date_end of the topmost calendar are in the future. Then the hours_per_day from the future calendar are taken not from the currently used one. The more specific calendars in regard of date_start and date_end are considered earlier than the less specific ones.
@ChristophAbenthungCibex ChristophAbenthungCibex force-pushed the 16.0-hr_employee_calendar_planning_incorrect_hours_per_day branch from 683735f to 71a2e6f Compare January 29, 2025 06:43
@ChristophAbenthungCibex ChristophAbenthungCibex marked this pull request as draft January 29, 2025 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants