Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
1598 Vistas

Hi good day everyone,



 I hope all is well. I just want to ask how to hide and unhide the trash icon on a one2many field in odoo 10 based on a condition.


Thank you very much in advance.


Sincerely yours,

​Jhonnel

Avatar
Descartar
Mejor respuesta

Hi,

To hide and unhide the trash icon on a one2many field in Odoo 10 based on a condition, you can use the attrs attribute to make the icon invisible based on the specified condition:

attrs="{'invisible': [(condition)]}".

For example:
<button name="unlink" type="object" icon="fa-trash" string="Delete" attrs="{'invisible': [('your_boolean_field', '=', False)]}" />


Hope it helps

Avatar
Descartar
Autor Mejor respuesta

Thank you very much for this answer.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
dic 23
1320
1
abr 23
1494
1
mar 23
2339
0
dic 22
1909
1
oct 21
3851