Commit c13d77d2 by Yvon

fix bug by ensuring argument passed to datetime.strptime is not False ; if…

fix bug by ensuring argument passed to datetime.strptime is not False ; if False, member is assumed to be exempted at date
parent b1eb6186
...@@ -20,8 +20,8 @@ class ShiftTemplate(models.Model): ...@@ -20,8 +20,8 @@ class ShiftTemplate(models.Model):
rec_date = datetime.strptime(rec_date, '%Y-%m-%d') rec_date = datetime.strptime(rec_date, '%Y-%m-%d')
for l in partner.leave_ids: for l in partner.leave_ids:
#_logger.debug("leave start end : %s %s", str(l.start_date), str(l.stop_date)) #_logger.debug("leave start end : %s %s", str(l.start_date), str(l.stop_date))
if (rec_date >= datetime.strptime(l.start_date, '%Y-%m-%d') and if (l.start_date is False or rec_date >= datetime.strptime(l.start_date, '%Y-%m-%d') and
rec_date <= datetime.strptime(l.stop_date, '%Y-%m-%d')): l.stop_date is False or rec_date <= datetime.strptime(l.stop_date, '%Y-%m-%d')):
answer = True answer = True
#_logger.debug("Partner will be still exempted") #_logger.debug("Partner will be still exempted")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment