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.