Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
2 Besvarelser
1667 Visninger

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
Kassér
Bedste svar

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
Kassér
Forfatter Bedste svar

Thank you very much for this answer.

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
dec. 23
1388
1
apr. 23
1555
1
mar. 23
2379
0
dec. 22
1967
1
okt. 21
3909