fix(workflow): Remove docstatus field from get_workflow_state_count (#19332)

remove docstatus from get_workflow_state_count as it is not being used
and causes error with postgresql as it requires the selected column
to either appear in the group by clause or an aggregat function


[skip ci]
This commit is contained in:
Ahmed Hasanin 2022-12-19 08:20:58 +02:00 committed by GitHub
parent 2fd2d426cc
commit 57bc2ebf57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -136,7 +136,7 @@ def get_workflow_state_count(doctype, workflow_state_field, states):
states = frappe.parse_json(states)
result = frappe.get_all(
doctype,
fields=[workflow_state_field, "count(*) as count", "docstatus"],
fields=[workflow_state_field, "count(*) as count"],
filters={workflow_state_field: ["not in", states]},
group_by=workflow_state_field,
)