fix: replace all spaces with _ to generate fieldname

This commit is contained in:
Shariq Ansari 2023-01-02 10:20:16 +05:30
parent 0e40dff4d7
commit 324c3e24c4
3 changed files with 7 additions and 3 deletions

View file

@ -279,7 +279,7 @@ export function scrub_field_names(fields) {
if (d.fieldtype) {
if (!d.fieldname) {
if (d.label) {
d.fieldname = d.label.trim().toLowerCase().replace(" ", "_");
d.fieldname = d.label.trim().toLowerCase().replaceAll(" ", "_");
if (d.fieldname.endsWith("?")) {
d.fieldname = d.fieldname.slice(0, -1);
}
@ -295,7 +295,7 @@ export function scrub_field_names(fields) {
}
} else {
d.fieldname =
d.fieldtype.toLowerCase().replace(" ", "_") +
d.fieldtype.toLowerCase().replaceAll(" ", "_") +
"_" +
frappe.utils.get_random(4);
}

View file

@ -0,0 +1,4 @@
<div>
<a href="{{ doc.route }}">{{ doc.title or doc.name }}</a>
</div>
<!-- this is a sample default list template -->

View file

@ -364,7 +364,7 @@
"icon": "icon-edit",
"is_published_field": "published",
"links": [],
"modified": "2022-12-15 17:14:44.939645",
"modified": "2023-01-02 10:19:15.680960",
"modified_by": "Administrator",
"module": "Website",
"name": "Web Form",