diff --git a/base/forms.py b/base/forms.py index 03ebd9fab..8e3fb5e65 100644 --- a/base/forms.py +++ b/base/forms.py @@ -2624,6 +2624,15 @@ class CompanyLeaveForm(ModelForm): fields = "__all__" exclude = ["is_active"] + def __init__(self, *args, **kwargs): + """ + Custom initialization to configure the 'based_on' field. + """ + super().__init__(*args, **kwargs) + self.fields["based_on_week"].widget.option_template_name = ( + "horilla_widgets/select_option.html" + ) + class PenaltyAccountForm(ModelForm): """ diff --git a/base/templates/company_leave/company_leave_creation_form.html b/base/templates/company_leave/company_leave_creation_form.html index 8e811edc8..6e5aaf81a 100644 --- a/base/templates/company_leave/company_leave_creation_form.html +++ b/base/templates/company_leave/company_leave_creation_form.html @@ -1,63 +1,43 @@ -{% load i18n %} {% if messages %} -