From fbab391b18957cd6f62b07982ff13a673812b463 Mon Sep 17 00:00:00 2001 From: pu-raihan Date: Fri, 11 Oct 2024 13:48:10 +0530 Subject: [PATCH] fix: check for options in if fieldtype select in fields_layout --- crm/fcrm/doctype/crm_fields_layout/crm_fields_layout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crm/fcrm/doctype/crm_fields_layout/crm_fields_layout.py b/crm/fcrm/doctype/crm_fields_layout/crm_fields_layout.py index fd37fba6..a5a4dd7b 100644 --- a/crm/fcrm/doctype/crm_fields_layout/crm_fields_layout.py +++ b/crm/fcrm/doctype/crm_fields_layout/crm_fields_layout.py @@ -34,7 +34,7 @@ def get_fields_layout(doctype: str, type: str): for field in section.get("fields") if section.get("fields") else []: field = next((f for f in fields if f.fieldname == field), None) if field: - if field.fieldtype == "Select": + if field.fieldtype == "Select" and field.options: field.options = field.options.split("\n") field.options = [{"label": _(option), "value": option} for option in field.options] field.options.insert(0, {"label": "", "value": ""})