[UPDT] ATTENDANCE: Updated attendance app by adding additional fields and functionality for grace time

This commit is contained in:
Horilla
2024-07-18 13:58:21 +05:30
parent c3cf975eeb
commit ad75e44689
12 changed files with 335 additions and 401 deletions

View File

@@ -970,12 +970,19 @@ class GraceTime(HorillaModel):
verbose_name=_("Allowed time"),
)
allowed_time_in_secs = models.IntegerField()
allowed_clock_in = models.BooleanField(
default=True, help_text=_("Allcocate this grace time for Check-In Attendance")
)
allowed_clock_out = models.BooleanField(
default=False, help_text=_("Allcocate this grace time for Check-Out Attendance")
)
is_default = models.BooleanField(default=False)
company_id = models.ManyToManyField(Company, blank=True, verbose_name=_("Company"))
objects = HorillaCompanyManager()
def __str__(self) -> str:
return str(f"{self.allowed_time} - Minutes")
return str(f"{self.allowed_time} - Hours")
def clean(self):
"""
@@ -999,7 +1006,11 @@ class GraceTime(HorillaModel):
.exists()
):
raise ValidationError(
_("There is already a grace time with this allowed time that exists.")
{
"allowed_time": _(
"There is already an existing grace time with this allowed time."
)
}
)
def save(self, *args, **kwargs):