ERPNext - How-to make part of an ERPNext document editable

Have you wondered how the field-level document permissions work in ERPNext? Look no further...

 · 2 min read


A customer asked me how they could give certain users the permission to modify only part of a document. Here we tell you how.


Specifically, they wanted to allow the Sales User role to be able to add customer part numbers to Items, but not allow any other edits.


Role Permissions Manager

Firstly we need to understand what permissions are available out of the box. Below we see the role permissions manager with two permissions on the Item doctype for the Sales User:

  1. Level 0: has read-only access. This is the standard permission
  2. Level 1: has read & write access. This is a custom permission that we have added as the Administrator user


We also need to know that all document fields in ERPNext have permission Level 0 applied as standard. A user must have Level 0 access to be able to see the document at all.

So this means that the Sales User can list the Items and view all fields in the Item out of the box.



Item

We also need to know that the Item document permissions also apply to any child tables and their fields. Below you can see all Item fields are greyed out except the Customer Items child table. So how did we apply Level 1 permissions to those fields?



Customize Form

As Administrator go to Item -> ... -> Customize and set the following fields to Level 1:

  1. Item -> Customer Items Table field (parent)
  2. Item Customer Detail -> Customer Name field (child)
  3. Item Customer Detail -> Customer Group field (child)
  4. Item Customer Detail -> Ref Code field (child)



That's it!

Note that all other roles will no longer have access to these fields at all, so you may need to add in additional Role Permissions for Level 1 for all the other roles.


No comments yet.

Add a comment
Ctrl+Enter to add comment