fix: show placeholder in fields from docfield
This commit is contained in:
parent
6be83291f3
commit
371a903ad7
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user