[FIX]allow_negative_leave_and_allocation:fix recorsed send to _check_holidays
This commit is contained in:
@@ -10,7 +10,7 @@ class HrLeave(models.Model):
|
||||
|
||||
@api.constrains('state', 'number_of_days', 'holiday_status_id')
|
||||
def _check_holidays(self):
|
||||
for holiday in self:
|
||||
if holiday.holiday_status_id.allows_negative:
|
||||
continue
|
||||
super()._check_holidays()
|
||||
# On ne garde que les congés qui ne permettent pas le négatif
|
||||
to_check = self.filtered(lambda h: not h.holiday_status_id.allows_negative)
|
||||
if to_check:
|
||||
super(HrLeave, to_check)._check_holidays()
|
||||
Reference in New Issue
Block a user