Merge pull request #294 from expsa/abuzar_fix_hr

fix bug
This commit is contained in:
AbuzarExp 2024-07-20 14:53:51 +03:00 committed by GitHub
commit 5cbc46a211
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 8 deletions

View File

@ -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'))