From f5144f429ca950956efa384b1e6cced15000acde Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 3 Feb 2025 20:17:47 +0530 Subject: [PATCH 1/2] fix: hide column from listview if field is hidden --- crm/api/doc.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crm/api/doc.py b/crm/api/doc.py index ad2cf99c..eba670c7 100644 --- a/crm/api/doc.py +++ b/crm/api/doc.py @@ -255,6 +255,8 @@ def get_data( if hasattr(_list, "default_list_data"): default_rows = _list.default_list_data().get("rows") + meta = frappe.get_meta(doctype) + if view_type != "kanban": if columns or rows: custom_view = True @@ -296,6 +298,11 @@ def get_data( if column.get("key") == "_liked_by" and column.get("width") == "10rem": column["width"] = "50px" + # remove column if column.hidden is True + column_meta = meta.get_field(column.get("key")) + if column_meta and column_meta.get("hidden"): + columns.remove(column) + # check if rows has group_by_field if not add it if group_by_field and group_by_field not in rows: rows.append(group_by_field) From 1eb63de3ce53bb5304e7b0189e660bc39491f9fc Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 3 Feb 2025 20:44:47 +0530 Subject: [PATCH 2/2] fix: export rows with default filters applied --- frontend/src/components/ViewControls.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/ViewControls.vue b/frontend/src/components/ViewControls.vue index 03ed5662..12f021ca 100644 --- a/frontend/src/components/ViewControls.vue +++ b/frontend/src/components/ViewControls.vue @@ -461,7 +461,12 @@ const export_all = ref(false) async function exportRows() { let fields = JSON.stringify(list.value.data.columns.map((f) => f.key)) - let filters = JSON.stringify(list.value.params.filters) + + let filters = JSON.stringify({ + ...props.filters, + ...list.value.params.filters, + }) + let order_by = list.value.params.order_by let page_length = list.value.params.page_length if (export_all.value) {