Ok I have had this issue for myself couple of times. Permissions and if_owner will not work. You need permissions filter query…
What I can understand is that you want to have restriction on documents which are viewed by your sales group on list view. They should be able to see documents only relevant to them (Relevant is the word and this is where you will have to apply some logic)…
I used Query Permissions hook to solve this for me…
https://frappe.io/docs/user/en/guides/basics/hooks#query-permissions
I had worked out similar thing for students doc type. Please refer the solution here for the same:
Here the logic was that only students can see documents relevant to them (only their enrollments, their fees only, etc). You can write some logic for your sales group.
Hope this helps and was relevant to what you were looking for…
regards,
Parth