Purchase Order List View Status not updating via Client Script (formatters not working)

Hi Team,

I am trying to customize the Purchase Order List View in ERPNext using Client Script.

Requirement:

  • When workflow_state = “Approved”
  • Show “To Receive and Bill” in List View (Status column)
  • Only UI change (no backend status update)

What I tried:
I created a Client Script with Apply To = List and used:

frappe.listview_settings[‘Purchase Order’] = {

get_indicator: function(doc) {
    if (doc.workflow_state === "Approved") {
        return ["To Receive and Bill", "blue"];
    }
    return [doc.status, "gray"];
},

formatters: {
    status: function(value, field, doc) {
        if (doc.workflow_state === "Approved") {
            return "To Receive and Bill";
        }
        return value;
    }
}

};

Issue:

  • Script is not applied in List View
  • No console log appears
  • Status still shows “Approved”
  • Works in theory but not executing

Environment:

  • ERPNext Version: (please add your version)
  • Frappe Version: (please add)

Question:

  • Is Client Script (List) supported for overriding listview_settings?
  • Is this a known limitation or bug?
  • What is the recommended way to override list view UI without changing backend status?

Expected:
List View should show “To Receive and Bill” instead of “Approved”

Thanks!

1 Like

Your Client Script is not working because List View does not support frappe.listview_settings through Client Script. This API is only executed from app-level JavaScript files, not from scripts created in the UI.

That’s why your code is not being loaded at all (no logs, no changes).

To achieve your requirement (UI-only change), you’ll need to add this logic in a custom JS file via a custom app or include it using app_include_js. This will not affect any backend data — it’s purely a frontend override.

1 Like

Hi @Meet-Tank4

Should work, even from client script …

Is your script enabled?

Hope this helps.

1 Like

this your solution is custimization code i have without code list setting chaneg purchase order possible ??? and your other solution with purchase order client script.. then tell me?

1 Like

already do this but not worked

1 Like