Wednesday, April 13, 2022
1 change · master
Resolved issues and error corrections
Time off requests now use the allocation with the most remaining days, rather than the largest original allocation. This prevents approved leave from being incorrectly charged to an allocation that no longer has enough days available, keeping employee balances accurate.
Original PR description
Steps : Create a Time Off Type T. Create 2 Allocations : > Type : T > Start date : monday D > End date : / > Number of days : resp 4 and 1 > Employee : Admin Create 2 Time Off Requests : > Type : T > Dates : resp monday D to thursday and friday to friday. Validate both. Issue : Allocation's days taken are resp 5.0/4.0 and 0.0/1.0. Cause : We set allocation to leave before validating. To do so, we take the alloc with max allocated days. Fix : Take the alloc with max days left = allocated - taken. Recompute the allocation before validating, to check that enough days are left. opw-2812534 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr