commit
cb2001662d
|
|
@ -487,14 +487,16 @@ class HRHolidays(models.Model):
|
|||
last_date = datetime.strftime(today, "{0}-12-31".format(years))
|
||||
last_date = datetime.strptime(str(last_date), "%Y-%m-%d").date()
|
||||
start_days = last_date - timedelta(days=int(holiday.remained_before))
|
||||
if today < last_date:
|
||||
|
||||
if start_days <= today < last_date:
|
||||
if today.weekday() != 6: # Send on Sunday only, not every day
|
||||
return
|
||||
balance = self.env['hr.holidays'].search([('employee_id', '=', emp.id),
|
||||
('holiday_status_id', '=', holiday.id),
|
||||
('type', '=', 'add'),
|
||||
('check_allocation_view', '=', 'balance')
|
||||
], limit=1, order="id desc")
|
||||
holi_balance = balance.remaining_leaves or 0.0
|
||||
if today >= start_days < last_date:
|
||||
if holi_balance > holiday.number_of_save_days:
|
||||
if emp.user_id:
|
||||
template = self.env.ref('hr_holidays_public.email_template_holiday_balance', False)
|
||||
|
|
|
|||
Loading…
Reference in New Issue