fix: show placeholder in fields from docfield

This commit is contained in:
Shariq Ansari 2024-09-28 21:34:03 +05:30
parent 6be83291f3
commit 371a903ad7
2 changed files with 4 additions and 2 deletions

View File

@ -611,10 +611,10 @@ def get_field_obj(field):
"all_properties": field,
}
obj["placeholder"] = "Add " + field.label + "..."
obj["placeholder"] = field.placeholder or "Add " + field.label + "..."
if field.fieldtype == "Link":
obj["placeholder"] = "Select " + field.label + "..."
obj["placeholder"] = field.placeholder or "Select " + field.label + "..."
obj["doctype"] = field.options
elif field.fieldtype == "Select" and field.options:
obj["options"] = [{"label": option, "value": option} for option in field.options.split("\n")]
@ -686,6 +686,7 @@ def get_fields(doctype: str, allow_all_fieldtypes: bool = False):
"mandatory_depends_on": field.mandatory_depends_on,
"read_only_depends_on": field.read_only_depends_on,
"link_filters": field.get("link_filters"),
"placeholder": field.placeholder,
})
return _fields

View File

@ -44,6 +44,7 @@ def get_fields_layout(doctype: str, type: str):
"type": field.fieldtype,
"options": field.options,
"mandatory": field.reqd,
"placeholder": field.placeholder,
}
section["fields"][section.get("fields").index(field["name"])] = field