diff --git a/frontend/src/components/FormField.vue b/frontend/src/components/FormField.vue index f26ed2a246..55c3856b6c 100644 --- a/frontend/src/components/FormField.vue +++ b/frontend/src/components/FormField.vue @@ -151,23 +151,6 @@ const props = defineProps({ const emit = defineEmits(["change", "update:modelValue"]) const dayjs = inject("$dayjs") -const SUPPORTED_FIELD_TYPES = [ - "Link", - "Select", - "Small Text", - "Text", - "Long Text", - "Text Editor", - "Check", - "Data", - "Float", - "Int", - "Section Break", - "Date", - "Time", - "Datetime", - "Currency", -] let linkFieldList = ref([]) let date = ref(null) @@ -175,7 +158,7 @@ let date = ref(null) const showField = computed(() => { if (props.readOnly && !isLayoutField.value && !props.modelValue) return false - return SUPPORTED_FIELD_TYPES.includes(props.fieldtype) && !props.hidden + return props.fieldtype !== "Table" && !props.hidden }) const isNumberType = computed(() => { diff --git a/frontend/src/components/FormView.vue b/frontend/src/components/FormView.vue index 53412be4ed..91b8b7392d 100644 --- a/frontend/src/components/FormView.vue +++ b/frontend/src/components/FormView.vue @@ -106,7 +106,7 @@ :errorMessage="field.error_message" :minDate="field.minDate" :maxDate="field.maxDate" - :addSectionPadding="fieldList[1].name !== field.name" + :addSectionPadding="fieldList[0].name !== field.name" /> diff --git a/frontend/src/views/salary_slip/Dashboard.vue b/frontend/src/views/salary_slip/Dashboard.vue index e139dd25a6..b97fa17b6b 100644 --- a/frontend/src/views/salary_slip/Dashboard.vue +++ b/frontend/src/views/salary_slip/Dashboard.vue @@ -121,7 +121,7 @@ function getPeriodLabel(period) { watch( () => selectedPeriod.value, (value) => { - let period = periodsByName.value[value.value] + let period = periodsByName.value[value?.value] documents.filters.start_date = [ "between", [period?.start_date, period?.end_date], diff --git a/hrms/api/__init__.py b/hrms/api/__init__.py index 09eb3e8907..a867180a01 100644 --- a/hrms/api/__init__.py +++ b/hrms/api/__init__.py @@ -4,6 +4,25 @@ from frappe.query_builder.functions import Count from frappe.utils import getdate +SUPPORTED_FIELD_TYPES = [ + "Link", + "Select", + "Small Text", + "Text", + "Long Text", + "Text Editor", + "Table", + "Check", + "Data", + "Float", + "Int", + "Section Break", + "Date", + "Time", + "Datetime", + "Currency", +] + @frappe.whitelist() def get_current_user_info() -> dict: @@ -405,7 +424,12 @@ def get_company_cost_center(company: str) -> str: # Form View APIs @frappe.whitelist() def get_doctype_fields(doctype: str) -> list[dict]: - return frappe.get_meta(doctype).fields + fields = frappe.get_meta(doctype).fields + return [ + field + for field in fields + if field.fieldtype in SUPPORTED_FIELD_TYPES and field.fieldname != "amended_from" + ] @frappe.whitelist()