Search code examples
odooodoo-9odoo-10

How to add icon in list view Odoo?


Is it possible add icon instead text in list view?

Example:

<field name="status" />

If status = phone display (icon="fa-phone) else status = fax display (icon="fa-fax).

Field display with string fax or phone.


Solution

  • You need to change icon name.

    Try with this:

    <field name="status" invisible='1'/>
    <button name="status" icon="fa-check text-success" attrs="{'invisible': ['|',('status','=','phone')]}" />
    <button name="status" icon="fa-times-circle text-danger" attrs="{'invisible': ['|',('status','=','fax')]}" />