In custom module, how to restrict user to allowed company only

I create a custom module and I added the company field to all doctypes, expecting it will show for every user the docs he for his/her company only.

what i got is…
the user sees all the docs, the company field is empty if not his/her company.

how to restrict the user for the allowed company, and if there is a way to do it module wise so all the doctypes of this module be affected?

If you are talking about a situation where the company is not set, and the document is still visible to the user, then check the “Apply Strict User Permission” checkbox in System Settings.

1 Like
1 Like