Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
5017 Weergaven

Hello does anyone have any idea or doc about return the attr like : invisible or required from on_change function?

Avatar
Annuleer
Beste antwoord

You can do it the following (indirect) way:

  • Use a hidden boolean field flag
  • For the field you want to set required or invisible use attrs="{'invisible': [('flag','=',True)]}"
  • In the on_change function you can now return the value for flag
Avatar
Annuleer
Auteur

Thank you Andre, but the field flag gonna save in database right?, and could we have another solution like return context or domain...?

Nice suggestion :)