Merge pull request #131 from expsa/abuzar_task_hr

[FIX] fix bug in hr
This commit is contained in:
AbuzarExp 2024-07-09 13:29:54 +03:00 committed by GitHub
commit 1c3f52ed6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -1409,7 +1409,7 @@ class HRHolidays(models.Model):
('type', '=', 'remove'),
('state', 'in', ('validate1', 'approved'))], limit=1, order="date_to desc")
if not prev_holiday: return
if not self.date_from or not self.date_to: return
if not self.date_from : return
date_from, last_dt_to = fields.Date.from_string(self.date_from), fields.Date.from_string(prev_holiday.date_to)
days_btwn = (date_from - last_dt_to).days - 1
if days_btwn < 1: return