commit
5cbc46a211
|
|
@ -297,15 +297,15 @@ class HrPersonalPermission(models.Model):
|
|||
if item.duration > item.permission_number:
|
||||
raise exceptions.Warning(
|
||||
_('This Duration not Allowed it must be Less Than or equal Permission Hours in Month'))
|
||||
for employee_permission in employee_permissions:
|
||||
if employee_permission.date_to and item.date_to:
|
||||
permission_date = datetime.strptime(str(employee_permission.date_to),
|
||||
DEFAULT_SERVER_DATETIME_FORMAT).date()
|
||||
date_to_value = datetime.strptime(str(item.date_to), DEFAULT_SERVER_DATETIME_FORMAT).date()
|
||||
|
||||
if employee_permissions.date_to and item.date_to:
|
||||
permission_date = datetime.strptime(str(employee_permissions.date_to),
|
||||
DEFAULT_SERVER_DATETIME_FORMAT).date()
|
||||
date_to_value = datetime.strptime(str(item.date_to), DEFAULT_SERVER_DATETIME_FORMAT).date()
|
||||
|
||||
if permission_date == date_to_value:
|
||||
raise exceptions.Warning(
|
||||
_('Sorry You Have Used All Your Permission In This Day you have one permission per a Day'))
|
||||
if permission_date == date_to_value:
|
||||
raise exceptions.Warning(
|
||||
_('Sorry You Have Used All Your Permission In This Day you have one permission per a Day'))
|
||||
else:
|
||||
raise exceptions.Warning(_('End Date must be greater than Start Date'))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue