odoo / odoo

Odoo. Open Source Apps To Grow Your Business.
https://www.odoo.com
Other
39.19k stars 25.38k forks source link

[17.0] hr_holidays: Time Off without Allocation #176149

Open ChristophAbenthungCibex opened 3 months ago

ChristophAbenthungCibex commented 3 months ago

Odoo Version

Steps to Reproduce

Steps to Reproduce:

  1. Login as Admin
  2. Go to Time Off -> Management / Approvals -> Allocations
  3. Check that Abigail Peterson has currently no Allocation for Paid time off
  4. Click New Button to create new allocation
  5. Select Abigail Peterson as Employee instead of Mitchell Admin
  6. Select 01/01/2024 as Start Date
  7. Select 05/01/2024 as End Date
  8. Set duration to 10
  9. Set any Description / name
  10. Save and Approve (confirm/validate) the allocation
  11. Click New Button to create new allocation
  12. Select Abigail Peterson as Employee instead of Mitchell Admin
  13. Select 12/01/2023 as Start Date
  14. Select 05/01/2024 as End Date
  15. Set duration to 10
  16. Set any Description / name
  17. Save and Approve (confirm/validate) the allocation
  18. Go to Time Off -> Management / Approvals -> Time Off
  19. Click New Button to create a new leave
  20. Remove Mitchell Admin from Employees field and add Abigail Peterson instead
  21. Set "from" to 05/01/2024 and "to" to "05/02/2024"
  22. Select Paid Time Off as Time off Type
  23. Save the leave
  24. Approve the leave

Expected behavior An error gets thrown because the employee has no allocation for 05/02/2024

Actual behavior The leave is valid and the employee can take the leave

Log Output

No response

Support Ticket

No response

MohdAlmosawy commented 3 months ago

Problem Summary:

The current validation mechanism for time-off requests works as expected when creating new requests, ensuring that the time-off period falls within the allocated date range and does not exceed the allocated days. However, when editing an existing, previously approved time-off request, the system bypasses the validation process, allowing the user to save changes that violate the allocation rules.

Steps to Reproduce:

As mentioned by @ChristophAbenthungCibex

Observations: