fix: list view formatting logic

This commit is contained in:
barredterra 2023-10-06 16:15:19 +02:00
parent d83b6758dd
commit 344a725d45

View file

@ -839,15 +839,18 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
frappe.model.is_numeric_field(df) ? "text-right" : "",
].join(" ");
const html_map = {
Subject: this.get_subject_html(doc),
Field: field_html(),
};
let column_html = html_map[col.type];
// listview_setting formatter
if (this.settings.formatters && this.settings.formatters[fieldname]) {
let column_html;
if (
this.settings.formatters &&
this.settings.formatters[fieldname] &&
col.type !== "Subject"
) {
column_html = this.settings.formatters[fieldname](value, df, doc);
} else {
column_html = {
Subject: this.get_subject_html(doc),
Field: field_html(),
}[col.type];
}
return `