[FIX] PAYROLL: Fixed detail view form employees without work info and dashboard export form select2

This commit is contained in:
Horilla
2025-10-04 20:59:08 +05:30
parent df92e9584e
commit baaf69d7c0
2 changed files with 11 additions and 4 deletions

View File

@@ -194,3 +194,11 @@ class DashboardExport(Form):
],
widget=forms.SelectMultiple,
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["employees"].widget.attrs.update({"class": "oh-select oh-select-2"})
self.fields["status"].widget.attrs.update({"class": "oh-select oh-select-2"})
self.fields["contributions"].widget.attrs.update(
{"class": "oh-select oh-select-2"}
)

View File

@@ -285,7 +285,7 @@ class Contract(HorillaModel):
verbose_name=_("Deduction For One Leave Amount"),
)
note = models.TextField(null=True, blank=True, max_length=255)
note = models.TextField(null=True, blank=True)
history = HorillaAuditLog(
related_name="history_set",
bases=[
@@ -372,8 +372,7 @@ class Contract(HorillaModel):
Detail view subtitle
"""
return f"""{self.employee_id.employee_work_info.department_id } /
{ self.employee_id.employee_work_info.job_position_id}"""
return f"{self.employee_id.get_department()} / {self.employee_id.get_job_position()}"
def contracts_detail(self):
"""
@@ -2086,7 +2085,7 @@ class LoanAccount(HorillaModel):
"""
Return subtitle containing both department and job position information.
"""
return f"{self.employee_id.employee_work_info.department_id} / {self.employee_id.employee_work_info.job_position_id}"
return f"{self.employee_id.get_department()} / {self.employee_id.get_job_position()}"
def get_installments(self):
"""