How to filter list view items

Is there any way to show items based on logged users roles

for example i have added user role field in item doctype

then when i save item i will select user role .

let if i added two roles role 1 and role 2

when i create item 1 i will select role 1 in user rolel field

then when i create item 2 i will select role 2 in user role

when user with role 1 sign in i need to show only item 1

is there is any easy way

if not how can i write a py or js code to do the same

hope my question i clear

please help

1 Like

I think you should setup User Permissions https://erpnext.org/docs/user/manual/en/setting-up/users-and-permissions/user-permissions

@saurabh6790
thanks for sharing this

if i do as in above link what i have to do is select every user sign in to my erp and give each one the permission

but instead what i want to do is show only based on role

hope now i clear to you

As per your design you need to do many changes in code, its not easy to implement.

Also, setting User Permission is one time activity. And you can import them using data import tool.

@saurabh6790 okey thanks for replay

can give me a small hint on where to start edit coding.

@shahid_ecit Do you just want to filter List View or you want these filters through out the system like reports, forms etc?

@saurabh6790 only list view

@shahid_ecit
Did you find any way? Even I have the same requirement like you.

@shahid_ecit
Did you get any solution? I have a similar requirement. I do not mind to write py or js code.