diff --git a/payroll/forms/component_forms.py b/payroll/forms/component_forms.py index 5c90f92a0..63893838f 100644 --- a/payroll/forms/component_forms.py +++ b/payroll/forms/component_forms.py @@ -729,6 +729,7 @@ class ReimbursementForm(ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + exclude_fields = [] if not self.instance.pk: self.initial["allowance_on"] = str(datetime.date.today()) @@ -766,6 +767,7 @@ class ReimbursementForm(ModelForm): attrs={"type": "date", "class": "oh-input w-100"} ) self.fields["attachment"] = MultipleFileField(label="Attachements") + self.fields["attachment"].widget.attrs["accept"] = ".jpg, .jpeg, .png, .pdf" # deleting fields based on type type = None diff --git a/payroll/forms/forms.py b/payroll/forms/forms.py index dfa3ad522..062304c3e 100644 --- a/payroll/forms/forms.py +++ b/payroll/forms/forms.py @@ -141,6 +141,9 @@ class ContractForm(ModelForm): first = PayrollGeneralSetting.objects.first() if first and self.instance.pk is None: self.initial["notice_period_in_days"] = first.notice_period + self.fields["contract_document"].widget.attrs[ + "accept" + ] = ".jpg, .jpeg, .png, .pdf" def as_p(self): """ @@ -183,6 +186,7 @@ class reimbursementCommentForm(ModelForm): super().__init__(*args, **kwargs) self.fields["files"] = MultipleFileField(label="files") self.fields["files"].required = False + self.fields["files"].widget.attrs["accept"] = ".jpg, .jpeg, .png, .pdf" def as_p(self): """ diff --git a/payroll/templates/payroll/reimbursement/request_cards.html b/payroll/templates/payroll/reimbursement/request_cards.html index 4a9a12ac8..22fc938cf 100644 --- a/payroll/templates/payroll/reimbursement/request_cards.html +++ b/payroll/templates/payroll/reimbursement/request_cards.html @@ -60,9 +60,9 @@
-
+ {% comment %}
{{ req.get_type_display }} -
+
{% endcomment %}
-
+ {% comment %}
{{ req.get_type_display }} -
+
{% endcomment %}
-
+ {% comment %}
{{ req.get_type_display }} -
+
{% endcomment %}