diff --git a/leave/forms.py b/leave/forms.py index 1f9ae33a8..f1ab3b2d3 100644 --- a/leave/forms.py +++ b/leave/forms.py @@ -139,18 +139,6 @@ class ConditionForm(forms.ModelForm): pass class LeaveTypeForm(ConditionForm): - require_approval = forms.CharField( - label="Require Approval", widget=forms.RadioSelect(choices=CHOICES) - ) - require_attachment = forms.CharField( - label="Require Attachment", widget=forms.RadioSelect(choices=CHOICES) - ) - exclude_company_leave = forms.CharField( - label="Exclude Company Leave", widget=forms.RadioSelect(choices=CHOICES) - ) - exclude_holiday = forms.CharField( - label="Exclude Holiday", widget=forms.RadioSelect(choices=CHOICES) - ) class Meta: model = LeaveType @@ -177,18 +165,6 @@ class LeaveTypeForm(ConditionForm): class UpdateLeaveTypeForm(ConditionForm): - require_approval = forms.CharField( - label="Require Approval", widget=forms.RadioSelect(choices=CHOICES) - ) - require_attachment = forms.CharField( - label="Require Attachment", widget=forms.RadioSelect(choices=CHOICES) - ) - exclude_company_leave = forms.CharField( - label="Exclude Company Leave", widget=forms.RadioSelect(choices=CHOICES) - ) - exclude_holiday = forms.CharField( - label="Exclude Holiday", widget=forms.RadioSelect(choices=CHOICES) - ) def __init__(self, *args, **kwargs): super(UpdateLeaveTypeForm, self).__init__(*args, **kwargs) diff --git a/leave/models.py b/leave/models.py index a3759e185..3f01cd934 100644 --- a/leave/models.py +++ b/leave/models.py @@ -168,17 +168,18 @@ class LeaveType(models.Model): max_length=30, choices=TIME_PERIOD, null=True, blank=True ) require_approval = models.CharField( - max_length=30, choices=CHOICES, null=True, blank=True + max_length=30, choices=CHOICES, null=True, blank=True,default="yes" ) require_attachment = models.CharField( max_length=30, choices=CHOICES, + default="no", null=True, blank=True, verbose_name=_("Require Attachment"), ) - exclude_company_leave = models.CharField(max_length=30, choices=CHOICES) - exclude_holiday = models.CharField(max_length=30, choices=CHOICES) + exclude_company_leave = models.CharField(max_length=30, choices=CHOICES,default="no") + exclude_holiday = models.CharField(max_length=30, choices=CHOICES,default="no") company_id = models.ForeignKey( Company, null=True, editable=False, on_delete=models.PROTECT ) diff --git a/leave/templates/leave/leave_type/leave_type_creation.html b/leave/templates/leave/leave_type/leave_type_creation.html index 6d4a31f25..27e615d7a 100644 --- a/leave/templates/leave/leave_type/leave_type_creation.html +++ b/leave/templates/leave/leave_type/leave_type_creation.html @@ -36,7 +36,7 @@