Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
1202 Vues

Good day everyone,


I just want to ask how can I hide a field/column in a tree view of odoo 10 based on a condition or a boolean field value?


Thank you very much in advance.

Avatar
Ignorer
Meilleure réponse

To hide a field in a tree view in Odoo 10 based on a condition or a boolean field value, you can use the attrs attribute in your XML view definition. Here’s an example of how you can achieve this:

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

If you want to hide the column, you can use 

<field name="your_field_name" attrs="{'column_invisible': [('boolean_field_name', '=', False)]}"/>



Hide column tree view | Odoo

Avatar
Ignorer
Auteur Meilleure réponse

Thanks, but I got it already and did it by putting context on its action.

Avatar
Ignorer
Publications associées Réponses Vues Activité
2
juil. 25
493
0
déc. 24
1099
1
août 24
2359
2
juil. 24
1606
1
juil. 24
1182