[FIX] fix bug in hr

This commit is contained in:
odex 2024-07-09 13:28:32 +03:00
parent 453a773c81
commit 7fa265cb7a
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