Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show placeholder in fields #383

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading