Skip to content

Commit

Permalink
fix: ignore dead columns in user_settings (#24572) (#24573)
Browse files Browse the repository at this point in the history
(cherry picked from commit 555bed3)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed Jan 29, 2024
1 parent 7f3a12b commit 5d2441d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions frappe/public/js/frappe/form/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -975,15 +975,17 @@ export default class Grid {

let user_settings = frappe.get_user_settings(this.frm.doctype, "GridView");
if (user_settings && user_settings[this.doctype] && user_settings[this.doctype].length) {
this.user_defined_columns = user_settings[this.doctype].map((row) => {
let column = frappe.meta.get_docfield(this.doctype, row.fieldname);

if (column) {
column.in_list_view = 1;
column.columns = row.columns;
return column;
}
});
this.user_defined_columns = user_settings[this.doctype]
.map((row) => {
let column = frappe.meta.get_docfield(this.doctype, row.fieldname);

if (column) {
column.in_list_view = 1;
column.columns = row.columns;
return column;
}
})
.filter(Boolean);
}
}

Expand Down

0 comments on commit 5d2441d

Please sign in to comment.