Skip to content

Commit

Permalink
fix: show placeholder in fields from docfield
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Sep 28, 2024
1 parent 6be8329 commit 371a903
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crm/api/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions crm/fcrm/doctype/crm_fields_layout/crm_fields_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 371a903

Please sign in to comment.