[UPDT] PAYROLL: Updated contract signal
This commit is contained in:
@@ -10,7 +10,6 @@ from payroll.models.models import Allowance, Contract, Deduction, LoanAccount, P
|
||||
|
||||
|
||||
@receiver(pre_save, sender=EmployeeWorkInformation)
|
||||
@receiver(post_save, sender=EmployeeWorkInformation)
|
||||
def employeeworkinformation_pre_save(sender, instance, **_kwargs):
|
||||
"""
|
||||
This method is used to override the save method for EmployeeWorkInformation Model
|
||||
@@ -21,7 +20,6 @@ def employeeworkinformation_pre_save(sender, instance, **_kwargs):
|
||||
if active_employee is not None:
|
||||
all_contracts = Contract.objects.entire()
|
||||
contract_exists = all_contracts.filter(employee_id_id=active_employee).exists()
|
||||
contract_exists = active_employee.contract_set.exists()
|
||||
if not contract_exists:
|
||||
contract = Contract()
|
||||
contract.contract_name = f"{active_employee}'s Contract"
|
||||
|
||||
Reference in New Issue
Block a user