First issue (functional)
------------------------
Steps to reproduce:
- create a type of leave
- create an allocation for X days for month A without end date
- create an allocation for Y days for month B without end date
- create a leave of X + Y days for month A
Remark:
Months A and B do not have to be consecutive.
Issue:
If allocations have not end date, it is possible to use allocation
in an other interval.
Second issue (display)
----------------------
On the dashboard we see the total number of allocations
even if we cannot place them for allocations without an end date.
This behavior contradicts that of allocations with an end date.
Solution:
---------
Make an additional check on the start date of an allocation.
This verification is very restrictive.
It stipulates that if the end date of a leave is before
the start date of an allocation, the allocation in question
must not be taken into account in the dynamic calculation
to link the allocations to the leaves.
In addition, this verification will make sure to trigger
the hack of the commit 02695aa095428b4ef5045f9c90d1b508ec9d896c.
Therefore a Validation Error will be raised.
From a display point of view, it will be fixed
on the dashboard and in the modal window to make a leave request.
opw-3230286
closesodoo/odoo#117024
X-original-commit: 745221b478e0a587ac51fd3f0fca8e067b473b12
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>