ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Read-only and empty should not hide the field

Currently, read-only fields are hidden if they are empty. I can see why this feature might have seen sensible in the past, but I can’t think of any good reason why this should actually be the case now.

I have just had yet another email from an employee requesting that I make a field visible. That field is already visible, but it is read-only and (in many cases) meaningfully empty. Consequently, it disappears.

I would therefore request that ERPNext stops hiding read-only fields that are hidden.

If I wanted a field hidden, I would have made it hidden.
If I want to make it hidden when it is empty, this would be easy to do with depends_on.
By hiding fields like this you can mess up the layout.

Currently there is no easy way to stop ERPNext hiding the field when it is empty. The only ‘fixes’ are hacks like putting in a default value (but this is a date field, so what is a default value for a date), or making it only read-only client-side with a script, or removing the ‘hidden’ part with a script. This is all unnecessarily complicated and hard to maintain.

5 Likes

I had the same problem, I solved this problem by use custom script to frm.set_value(“name field readonly”, 0)
Hope this can help you.

This would be something to address in frappe not ERPNext.

+1 for this change request. I have some fields that can only be changed via custom dialogs, but I would still like them to be visible when they have no value.

1 Like

For still showing the read-only field when empty, you can set the field to data type and set the read-only parameter inside the field detail popup.