Search code examples
odoo-11

how to add icon to a module on the menu of application?


i'm using odoo 11 and i have installed open HRMS core which install a specific theme. After that i have installed another module which named overtime (bt_hr_overtime_automatic) to satisfy my needs but the problem is in the menu of the apps the new module doesn't has a icon and i want to add one(Ps: the module has a picture named "icon.png" in the folder /static/description/). Any idea on how to do that ?

enter image description here

enter image description here


Solution

  • You must use "web_icon" in your menu to show your own icon. Save your icon in a directory. Size can be 256x256 File format should be .ico

    Don't forget to upgrade your module after adding this code. Sometimes cache will show the old icon, if so try this in incognito mode or clear the cache

    web_icon="your_module_name,static/description/icon.ico".
    

    Example Code:

    <menuitem name="Overtime" id="your_menu_id" action="your_action_id" web_icon="your_module_name,static/description/icon.ico"/>
    

    Front End:

    If you want to add it in front end Go to Settings-->Technical Settings-->Menu Item-->Your Menu-->Web Icon File Please refer screen shot

    icon for menu in odoo