Hide DocType Section for some users

Hi everyone,

I would like to hide some section on a DocType Form for some user Role.

My main goal is to basically simplifie the creation of a Sales Order for some of my users. So far I have manage to hide some Fields by setting the Perm Level.

Unfortunately, I am not able to hide an entire section. Which I actually need as I want to simplify the creation of Sales Order (or other DocType) as much as possible.

What would be the recommended way to do so? I am open to other approach as well.

For example I want to be able to hide for some role to hide the Accounting Dimensions section.

Thanks for your help,
Charles

1 Like

I don’t remember exactly (not in mhy working computer), but maybe these will help.

Select Customize the doctype,
for the Section Break field, turn on hidden, fill the Display When with eval: which evaluate user’s role.

1 Like

Thanks, @rahy, I manage to do it based on your suggestion by adding this code:

eval:!frappe.user.has_role("Test Role")

In the Permissions > “Depends On” input field.
This hides the Section Break for all user with role “Test Role”.

4 Likes