[FIX]allow_negative_leave_and_allocation:fix recorsed send to _check_holidays

This commit is contained in:
2025-09-30 18:10:41 +02:00
parent dc5fd2897a
commit 6c008cce4d
2 changed files with 5 additions and 5 deletions

View File

@@ -3,7 +3,7 @@
{ {
"name": "allow_negative_leave_and_allocation", "name": "allow_negative_leave_and_allocation",
"version": "16.0.1.0.2", "version": "16.0.1.1.0",
"author": "Elabore", "author": "Elabore",
"website": "https://elabore.coop", "website": "https://elabore.coop",
"maintainer": "Elabore", "maintainer": "Elabore",

View File

@@ -10,7 +10,7 @@ class HrLeave(models.Model):
@api.constrains('state', 'number_of_days', 'holiday_status_id') @api.constrains('state', 'number_of_days', 'holiday_status_id')
def _check_holidays(self): def _check_holidays(self):
for holiday in self: # On ne garde que les congés qui ne permettent pas le négatif
if holiday.holiday_status_id.allows_negative: to_check = self.filtered(lambda h: not h.holiday_status_id.allows_negative)
continue if to_check:
super()._check_holidays() super(HrLeave, to_check)._check_holidays()