Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
1158 Visualizações

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
Cancelar
Melhor resposta

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
Cancelar
Autor Melhor resposta

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

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
2
jul. 25
423
0
dez. 24
1065
1
ago. 24
2310
2
jul. 24
1553
1
jul. 24
1118