fix(quick_list_widget):workflow-state-not-showing (#27596)

* fix(quick_list_widget):workflow-state-not-showing

when a document has workflow state, it should show workflow_status. Instead it doesn't.

existing code put a validation if status exist, but a document can have a workflow_state without a "status" field.

the correct approach is to separate the logic.

* fix(quick_list_widget):follow-suggestioin-to-remove-unnecessary-validation

Co-authored-by: Akhil Narang <me@akhilnarang.dev>

---------

Co-authored-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
foolishdino 2024-09-10 16:27:34 +07:00 committed by GitHub
parent 425d409422
commit 3fe34b2f18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -197,12 +197,10 @@ export default class QuickListWidget extends Widget {
if (this.has_status_field) {
fields.push("status");
fields.push("docstatus");
// add workflow state field if workflow exist & is active
let workflow_fieldname = frappe.workflow.get_state_fieldname(this.document_type);
workflow_fieldname && fields.push(workflow_fieldname);
}
// add workflow state field if workflow exist & is active
let workflow_fieldname = frappe.workflow.get_state_fieldname(this.document_type);
workflow_fieldname && fields.push(workflow_fieldname);
fields.push("modified");
let quick_list_filter = frappe.utils.process_filter_expression(this.quick_list_filter);