[UPDT] BASE: Updated CompanyLeave form __init__
This commit is contained in:
@@ -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"
|
||||
)
|
||||
|
||||
@@ -1 +1 @@
|
||||
<option value="{{ widget.value|stringformat:'s' }}" {% include "horilla_widgets/attr.html" %}>{{ widget.label }}</option>
|
||||
<option value="{{ widget.value|stringformat:'s' }}" {% include "horilla_widgets/attr.html" %} {% if widget.selected %} selected="selected"{% endif %} >{{ widget.label }}</option>
|
||||
|
||||
Reference in New Issue
Block a user