[UPDT] PAYROLL: Update contract creation signals for employee

This commit is contained in:
Horilla
2025-04-05 14:34:23 +05:30
parent c6a5c0e9a1
commit f2c17aa283
3 changed files with 14 additions and 10 deletions

View File

@@ -15,7 +15,9 @@ def employeeworkinformation_pre_save(sender, instance, **_kwargs):
This method is used to override the save method for EmployeeWorkInformation Model
"""
active_employee = (
instance.employee_id if instance.employee_id.is_active == True else None
instance.employee_id
if instance.employee_id and instance.employee_id.is_active == True
else None
)
if active_employee is not None:
all_contracts = Contract.objects.entire()