Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3538 Vizualizări

I need to detect when a user is in add (new) mode when the view is loaded or in edit mode.

I need this because I want to hide a few fields when the user is adding a new entry and show them when the user is editing an entry.

TIA

Imagine profil
Abandonează
Cel mai bun răspuns

Use invisible attribut with dynamic conditions. See for example:

<field name="field1"/>
<field name="field2" attrs="{'invisible':[('field1','=','some_value')]}"/>

field2 will show or not depended from value field1.

Imagine profil
Abandonează