[FIX] ATTENDANCE: Hour count filter month to drop down list

This commit is contained in:
teamhorilla@gmail.com
2023-10-02 01:44:58 +05:30
parent 6dae8d0f5b
commit 4bbf5b08f1
2 changed files with 17 additions and 2 deletions

View File

@@ -98,7 +98,20 @@ class AttendanceOverTimeFilter(FilterSet):
Args:
FilterSet (class): custom filter set class to apply styling
"""
MONTH_CHOICES = [
('January', 'January'),
('February', 'February'),
('March', 'March'),
('April', 'April'),
('May', 'May'),
('June', 'June'),
('July', 'July'),
('August', 'August'),
('September', 'September'),
('October', 'October'),
('November', 'November'),
('December', 'December'),
]
search = django_filters.CharFilter(method=filter_by_name)
hour_account__gte = DurationInSecondsFilter(
@@ -113,7 +126,7 @@ class AttendanceOverTimeFilter(FilterSet):
overtime__lte = DurationInSecondsFilter(
field_name="overtime_second", lookup_expr="lte"
)
month = django_filters.CharFilter(field_name="month", lookup_expr="icontains")
month = django_filters.ChoiceFilter(choices=MONTH_CHOICES,lookup_expr="icontains")
class Meta:
"""

View File

@@ -60,6 +60,8 @@
<label class="oh-label">{% trans "Overtime" %}</label>
{{f.form.overtime}}
</div>
</div>
<div class="col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label">{% trans "Year" %}</label>
{{f.form.year}}