Is there a way to customize the List View query in Frappe?

Hi ,

I want to customize the List view for doctype to display only the records with workflow_state == “approved” .

is there any way to achieve this?

@maliknaqibullah filters can do such job

@bahaou Thank you , I don’t want that user with that specific role to access other records if we use filter it can be removed from URL.

@maliknaqibullah use list js to add filters.

that is basically same as applying filters, I have tried it and it only add filters to the URL.

You can use the permission_query_conditions hook.
https://frappeframework.com/docs/user/en/python-api/hooks#modify-list-query

what is faster this
or custom in hook