From b6f2fd51278724fc5be968fbb5a9e0fbd5b37a8e Mon Sep 17 00:00:00 2001 From: Horilla Date: Mon, 9 Oct 2023 11:58:52 +0530 Subject: [PATCH] [FIX] LEAVE: Remove leave type leave calculation method, leave type creation/updation form --- leave/forms.py | 4 +++- leave/templates/leave/leave_type_creation.html | 6 +++--- leave/templates/leave/leave_type_update.html | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/leave/forms.py b/leave/forms.py index f330ed887..23e29f368 100644 --- a/leave/forms.py +++ b/leave/forms.py @@ -112,6 +112,8 @@ class LeaveTypeForm(ConditionForm): } widgets = { "color": TextInput(attrs={"type": "color", "style": "height:40px;"}), + "period_in": forms.HiddenInput(), + "total_days": forms.HiddenInput(), } def clean(self): @@ -161,7 +163,7 @@ class UpdateLeaveTypeForm(ConditionForm): class Meta: model = LeaveType fields = "__all__" - + exclude = ["period_in", "total_days"] widgets = { "color": TextInput(attrs={"type": "color", "style": "height:40px;"}), } diff --git a/leave/templates/leave/leave_type_creation.html b/leave/templates/leave/leave_type_creation.html index 403cc4db5..efd66c320 100644 --- a/leave/templates/leave/leave_type_creation.html +++ b/leave/templates/leave/leave_type_creation.html @@ -63,21 +63,21 @@
- + {{form.count}} {{form.count.errors}}
- + {% comment %} {% endcomment %} {{form.period_in}} {{form.period_in.errors}}
- + {% comment %} {% endcomment %} {{form.total_days}} {{form.total_days.errors}}
diff --git a/leave/templates/leave/leave_type_update.html b/leave/templates/leave/leave_type_update.html index e57b49a9c..11288012a 100644 --- a/leave/templates/leave/leave_type_update.html +++ b/leave/templates/leave/leave_type_update.html @@ -65,21 +65,21 @@
- + {{form.count}} {{form.count.errors}}
- + {% comment %} {% endcomment %} {{form.period_in}} {{form.period_in.errors}}
- + {% comment %} {% endcomment %} {{form.total_days}} {{form.total_days.errors}}