Skip to content
Snippets Groups Projects
Commit 3f15355c authored by Florian Damhaut's avatar Florian Damhaut
Browse files

[FIX] hr_holidays : Only request both approval for employee request


Current behaviour :
When creating a leave type with both approval required for allocation and then setting allocation to 'Set by time off officer', we still require 2 approvals.

Behaviour after PR :
Leave type with allocation set to 'Set by time off officer' will only require one approval as expected.

opw-2671540

closes odoo/odoo#79718

Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
parent 66a1e96f
Branches
Tags
No related merge requests found
......@@ -300,7 +300,7 @@ class HolidaysAllocation(models.Model):
def _compute_can_approve(self):
for allocation in self:
try:
if allocation.state == 'confirm' and allocation.validation_type == 'both':
if allocation.state == 'confirm' and allocation.holiday_status_id.allocation_type == "fixed_allocation" and allocation.validation_type == 'both':
allocation._check_approval_update('validate1')
else:
allocation._check_approval_update('validate')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment