[FIX] LEAVE: Attendance field in compensatory updated as required field
This commit is contained in:
@@ -1349,7 +1349,7 @@ if apps.is_installed("attendance"):
|
||||
def clean(self):
|
||||
cleaned_data = super().clean()
|
||||
attendance_id = cleaned_data.get("attendance_id")
|
||||
if attendance_id is None:
|
||||
if attendance_id is None or len(attendance_id) < 1:
|
||||
raise forms.ValidationError(
|
||||
{"attendance_id": _("This field is required.")}
|
||||
)
|
||||
|
||||
@@ -1079,7 +1079,8 @@ if apps.is_installed("attendance"):
|
||||
Employee, on_delete=models.CASCADE, verbose_name="Employee"
|
||||
)
|
||||
attendance_id = models.ManyToManyField(
|
||||
"attendance.Attendance", verbose_name="Attendance", blank=True
|
||||
"attendance.Attendance",
|
||||
verbose_name="Attendance",
|
||||
)
|
||||
requested_days = models.FloatField(blank=True, null=True)
|
||||
requested_date = models.DateField(default=timezone.now)
|
||||
|
||||
Reference in New Issue
Block a user