Search code examples
odooodoo-8

Adding icons to menu items in odoo


I try to set an icon to menuitem, So I find that the attribute icon is supported, but No change happen when I change its value.

I want to know if it is still supported by menuitem in odoo v7/8. If not, how to add an icon to a menu item?

Edit:

I try to customize the view of the menu in odoo. So I override the template that render the menu in "webClient_templates.xml" from web module like this:

<template id="my_menu_link" inherit_id="web.menu_link">
  <span position="replace">
     <span class="oe_menu_text">
        <i class="fa fa-check"></i>
        <t t-esc="menu['name']"/>
     </span>
  </span>
</template>

Likely, all the menu items will have the same icon (i.e. fa-check) from font-awesome lib. Now, I try to add a specific icon for each menu item, that I can define it somehow in the xml description of menuitem as a kind of attribute or anything else, and retrieve it like this:

<i t-attrs-class="menu['icon']"></i>

I tried to use icon attribute of menuitem, even if it's deprecated, but menu['icon'] is not recognized in the template level.

Please any suggestions ?


Solution

  • AFAIK displaying icons in menu items is deprecated and does not work on the web client. Probably the to achieve you would need to create a module for the web client extending it with that capability.