Welcome!

This community is for professionals and enthusiasts of our products and services.Share and discuss the best content and new marketing ideas,build your professional profile and become a better marketer together.

Register
0

How can I dynamically set field attributes in a form view based on another field’s value?

By
Diogo Duarte
on 11/4/15, 10:41 PM561 views

How can I dynamically set field attributes in a form view based on another field’s value?


0
Diogo Duarte
On11/4/15, 10:43 PM

You can use the attrs attribute in a form field view to dynamically set its attributes based on another field’s value like:

<field name="field_name" attrs="{'field_attribute': field_domain}"/>

The attrs takes a Python dictionary and maps element's attributes to domains. For example, you could hide a field like:

<field name="id" attrs="{'invisible': [('is_admin', '=', False)]}"/>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, justuse the commenting tool. Please remember that you can alwaysrevise your answers - no need to answer the same question twice. Also, pleasedon't forget to vote - it really helps to select the best questions and answers!

Keep Informed

About This Community

This community is for professionals and enthusiasts of our products and services.Share and discuss the best content and new marketing ideas,build your professional profile and become a better marketer together.

Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 11/4/15, 10:41 PM
Seen: 561 times
Last updated: 11/4/15, 10:43 PM