Help with user permission

Please help with setting permissions for users.
How we can implement this:

  • user 1 has user permission for branch 1

  • user 2 has user permission for branch 2

  • user 3 has user permission for branch 3.

  • customer 1 is linked with branch 1 - user 1 sees it, but users 2 and 3 do not see;

  • customer 2 is linked with branch 1 and 2 - users 1 and 2 see it, but user 3 does not see it.

I tried create Child Table for Branch DocType and add this Child Table DocType to Customer DocType as Table field. But user permission does not work on this.

1 Like

Is Table MultiSelect present in ERPNext v11.1.4?

Got it with document hooks permission_query_conditions and has_permission, child table doctype and custom field type table in origin doctypes.

@ukp can you share how you applied permissions for child table,
i’ve exactly same problem.

@ukp - Can you help me with your approach, I am facing a similar issue.

I have provided user permission to Sales Person doctype to the users who are the sales person, and the sales person is added to the sales_team child table of the Sales Invoice. The users are able to see all the Sales Invoice in the List View (though not able to open) but in the report view they can see everything.