From 1dc11c8da05b6858e09ed8ef811039664de0d940 Mon Sep 17 00:00:00 2001 From: Horilla Date: Mon, 20 Oct 2025 17:35:14 +0530 Subject: [PATCH] [UPDT] BASE: Updated CompanyLeave form __init__ --- base/forms.py | 2 ++ horilla_widgets/templates/horilla_widgets/select_option.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/base/forms.py b/base/forms.py index b7619be04..81030dc55 100644 --- a/base/forms.py +++ b/base/forms.py @@ -2771,6 +2771,8 @@ class CompanyLeaveForm(ModelForm): Custom initialization to configure the 'based_on' field. """ super().__init__(*args, **kwargs) + choices = [("", "All")] + list(self.fields["based_on_week"].choices[1:]) + self.fields["based_on_week"].choices = choices self.fields["based_on_week"].widget.option_template_name = ( "horilla_widgets/select_option.html" ) diff --git a/horilla_widgets/templates/horilla_widgets/select_option.html b/horilla_widgets/templates/horilla_widgets/select_option.html index 3933c5ab8..01c7d353e 100644 --- a/horilla_widgets/templates/horilla_widgets/select_option.html +++ b/horilla_widgets/templates/horilla_widgets/select_option.html @@ -1 +1 @@ - +