Display Depends On, Hidden not working on Read Only Type field

Hi there,

seems Display Depends On not working on Read Only Type field, see pics:

Field definition:

it’s displayed even if condition is false:

Can you please have a look?

Opened an Issue

https://github.com/frappe/frappe/issues/2706

1 Like

I think it should be “==” not “===”

@johnskywalker …I don’t think so …if you change to Data field it works properly …it fail on ReadOnly

Any news on this?

It seems setting Read Only as Hidden doesn’t work as well …

Is that by design?

Any news guys ?

You may try to:

2 Likes

not working

On Data type it should work

1 Like

@JoEz i try it it didn’t work

That’s strange …I’m using it and working fine

it just disappeared !

Same issue, is there any update ?!

Try to set fields properties hidden & read only through custom script.

For Read Only :
frm.toggle_enable("field_name", false);

For Hiding:
cur_frm.toggle_display("field_name", false);

hai all any solution yet…@shahid i have try read only script but error appear.

i`m using
ERPNext: v11.1.14 (master)
Frappe Framework: v11.1.14 (master)
Jodit: v0.0.1 (master)

@Mohd_Rizal_sharif can you share your script here?

i Customize Form Quotation , and put "Depends on to label “Total” command

eval:doc.discount_amount !=0

which mean if discount_amount not equal to zero it will appear… but total is read only… also iwant hide it on print if syntax is false.

1 Like

Change its field type from read only to Currency or Float, and check readonly checkbox under it, then it will automatically appears when it have some value. see below image…
readonly

And for print hide if there is no value.
you can check print hide if no value. see below image. (option will appear when you select field type as currency or float)
printhide

i did put custom script on quotation

frm.toggle_enable(“field_name”, false);

but it cannot untick readonly , its said i`m not to edit this to read-only and also its say script was error

+main point is i want to enable print hide “Total” if no discount

Are you editing it from Doctype? you should edit the standard doctypes using Customize Form.

here where i did…