Odoo Help


How to put a menu Icon in odoo 9?

Baintex Technologies S.L.
on 8/22/16, 6:16 AM 2,657 views

I want to put a menu icon for the hr_attendance addon.

I will explain the steps that i have done:

1. Create hr_attendance_extend an put it in addon_extra

2. Import the original addon. This is "__init__.py:

import hr_attendance

3. Create the css and put the icon. This is a piece of the file "static/src/css/slider.css":


.oe_systray .oe_attendance_signout {


height: 32px;

width: 32px;

background: url(/hr_attendance_extend/static/src/img/emp-in32.png);

cursor: pointer;



4. Link the file with the addon. This is the file ''views/hr_attendance.xml":

<?xml version="1.0" encoding="utf-8"?>



<template id="assets_backend" name="hr_attendance assets" inherit_id="web.assets_backend">

<xpath expr="." position="inside">

  <link rel="stylesheet" href="/hr_attendance_extend/static/src/css/slider.css"/>





5. Put the new files in the new addon. This is part of the file "__openerp__.py":



'depends': ['hr_attendance'],

'data': [




'demo': [],

'test': [],

'installable': True,

'auto_install': False,


'qweb' : ["static/src/xml/attendance.xml"],


6. Put the container for the menu. This is the file ''static/src/xml/attendance.xml":


<t t-name="AttendanceSlider">

<li class="oe_attendance_status oe_attendance_nosigned" data-toggle="tooltip">

  <div class="oe_attendance_signout"></div>




In the original addon (hr_attendance) there is a function that it pushes the icon to the menu (I think). 

There is in the file static/src/js/attendance.js and that is the line in question:


That's all.

I don't know if I am missing something.  The code of the icon appears in the html, but there is with 'style="display: none"'


Giezel Esteves, thanks for the interest, but that doesn't fix anything.

I have an icon.png in the folder.

Nevertheless, I realized what was wrong.

The problem is that my current user is not an employee, and that's the reason of the "style=display: none;"
I assigned an employee to the user and now the icon appears.

Jérôme Thériault
On 4/26/17, 10:29 AM

Since this shows up first in Google, I thought I'd add this answer.

Let's say you want to use your module icon as your main menu icon.

  1. Make sure this file exists: module_name/static/description/icon.png

  2. In the XML where you define your main menu, add the web_icon attribute:

    <menuitem name="My App" id="module_name.menu_root" web_icon="module_name,static/description/icon.png"/>
  3. Upgrade your module

Giezel Esteves
On 8/23/16, 9:35 PM

just add your icon.png inside your description folder


restart odoo-server

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/22/16, 6:16 AM
Seen: 2657 times
Last updated: 9/15/17, 6:31 AM