Pointer
Pointer

Reputation: 2186

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.

Upvotes: 2

Views: 2706

Answers (1)

user_odoo
user_odoo

Reputation: 2358

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')]}" />

Upvotes: 3

Related Questions