Merge pull request #31204 from sokumon/breadcrumb

fix: check if doc name is string
This commit is contained in:
Soham Kulkarni 2025-02-10 14:52:03 +05:30 committed by GitHub
commit d4fcdecee4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -656,8 +656,10 @@ $.extend(frappe.model, {
},
get_doc_title(doc) {
if (doc.name.startsWith("new-" + doc.doctype.toLowerCase().replace(/ /g, "-"))) {
return __("New {0}", [__(doc.doctype)]);
if (typeof doc.name == "string") {
if (doc.name.startsWith("new-" + doc.doctype.toLowerCase().replace(/ /g, "-"))) {
return __("New {0}", [__(doc.doctype)]);
}
}
let meta = frappe.get_meta(doc.doctype);
if (meta.title_field) {