fix(list_view): check that a title field is set before trying to use it

Otherwise enabling the checkbox for `Warehouse` and trying to load `Stock Ledger Entry`
results in `warehouse. as warehouse_`

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2024-11-11 13:55:45 +05:30
parent c62e7334bc
commit a1b4d44b62
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

View file

@ -209,7 +209,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
) {
frappe.model.with_doctype(df.options, () => {
const meta = frappe.get_meta(df.options);
if (meta.show_title_field_in_link) {
if (meta.show_title_field_in_link && meta.title_field) {
this.link_field_title_fields[
typeof f === "string" ? f : f.fieldname
] = meta.title_field;