Skip to Content
Menu
This question has been flagged
2 Replies
1691 Rodiniai

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

Portretas
Atmesti
Best Answer

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

Portretas
Atmesti
Autorius Best Answer

Thank you very much for this answer.

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
gruod. 23
1393
1
bal. 23
1558
1
kov. 23
2385
0
gruod. 22
1972
1
spal. 21
3920