From 9f7b0bb5c678a968741a2c98f52fe9f478c11d70 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 14 Aug 2024 15:25:23 +0530 Subject: [PATCH] fix: default list columns doesn't work --- crm/api/doc.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crm/api/doc.py b/crm/api/doc.py index e0a0da26..aeb76a6f 100644 --- a/crm/api/doc.py +++ b/crm/api/doc.py @@ -246,8 +246,9 @@ def get_data( is_default = True data = [] _list = get_controller(doctype) + default_rows = [] if hasattr(_list, "default_list_data"): - rows = _list.default_list_data().get("rows") + default_rows = _list.default_list_data().get("rows") if view_type != "kanban": if columns or rows: @@ -278,6 +279,7 @@ def get_data( rows = frappe.parse_json(list_view_settings.rows) is_default = False elif not custom_view or is_default and hasattr(_list, "default_list_data"): + rows = default_rows columns = _list.default_list_data().get("columns") # check if rows has all keys from columns if not add them @@ -302,6 +304,9 @@ def get_data( ) or [] if view_type == "kanban": + if not rows: + rows = default_rows + if not kanban_columns and column_field: field_meta = frappe.get_meta(doctype).get_field(column_field) if field_meta.fieldtype == "Link":