From 6c008cce4daff8dd43c4629462cb3264aa26a449 Mon Sep 17 00:00:00 2001 From: Laetitia Da Costa Date: Tue, 30 Sep 2025 18:10:41 +0200 Subject: [PATCH] [FIX]allow_negative_leave_and_allocation:fix recorsed send to _check_holidays --- allow_negative_leave_and_allocation/__manifest__.py | 2 +- allow_negative_leave_and_allocation/models/hr_leave.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/allow_negative_leave_and_allocation/__manifest__.py b/allow_negative_leave_and_allocation/__manifest__.py index f4d5139..8d7ac7b 100644 --- a/allow_negative_leave_and_allocation/__manifest__.py +++ b/allow_negative_leave_and_allocation/__manifest__.py @@ -3,7 +3,7 @@ { "name": "allow_negative_leave_and_allocation", - "version": "16.0.1.0.2", + "version": "16.0.1.1.0", "author": "Elabore", "website": "https://elabore.coop", "maintainer": "Elabore", diff --git a/allow_negative_leave_and_allocation/models/hr_leave.py b/allow_negative_leave_and_allocation/models/hr_leave.py index dfe5561..9c196bd 100644 --- a/allow_negative_leave_and_allocation/models/hr_leave.py +++ b/allow_negative_leave_and_allocation/models/hr_leave.py @@ -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() \ No newline at end of file + # 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() \ No newline at end of file