fix: include standard fields in column fields list
This commit is contained in:
parent
87862c9603
commit
2e5675badb
@ -69,9 +69,6 @@ def get_list_data(doctype: str, filters: dict, order_by: str):
|
|||||||
if column.get("key") not in rows:
|
if column.get("key") not in rows:
|
||||||
rows.append(column.get("key"))
|
rows.append(column.get("key"))
|
||||||
|
|
||||||
if "name" not in rows:
|
|
||||||
rows.append("name")
|
|
||||||
|
|
||||||
data = frappe.get_all(
|
data = frappe.get_all(
|
||||||
doctype,
|
doctype,
|
||||||
fields=rows,
|
fields=rows,
|
||||||
@ -90,6 +87,20 @@ def get_list_data(doctype: str, filters: dict, order_by: str):
|
|||||||
fields = [field for field in fields if field.fieldtype not in not_allowed_fieldtypes]
|
fields = [field for field in fields if field.fieldtype not in not_allowed_fieldtypes]
|
||||||
fields = [{"label": field.label, "value": field.fieldname} for field in fields if field.label and field.fieldname]
|
fields = [{"label": field.label, "value": field.fieldname} for field in fields if field.label and field.fieldname]
|
||||||
|
|
||||||
|
std_fields = [
|
||||||
|
{'label': 'Name', 'value': 'name'},
|
||||||
|
{'label': 'Created On', 'value': 'creation'},
|
||||||
|
{'label': 'Last Modified', 'value': 'modified'},
|
||||||
|
{'label': 'Modified By', 'value': 'modified_by'},
|
||||||
|
{'label': 'Owner', 'value': 'owner'},
|
||||||
|
]
|
||||||
|
|
||||||
|
for field in std_fields:
|
||||||
|
if field.get('value') not in rows:
|
||||||
|
rows.append(field.get('value'))
|
||||||
|
if field not in fields:
|
||||||
|
fields.append(field)
|
||||||
|
|
||||||
return {'data': data, 'columns': columns, 'rows': rows, 'fields': fields}
|
return {'data': data, 'columns': columns, 'rows': rows, 'fields': fields}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user