[IMP] Improved code to show need action counter

bzr revid: tpa@tinyerp.com-20120330105731-ss03y3l4fi5mq3jd
This commit is contained in:
Turkesh Patel (Open ERP)
2012-03-30 16:27:31 +05:30
parent 7b9af7dd22
commit f8510eee62
3 changed files with 18 additions and 2 deletions
+2 -2
View File
@@ -875,13 +875,13 @@ class Menu(openerpweb.Controller):
context = req.session.eval_context(req.context)
Menus = req.session.model('ir.ui.menu')
menu_roots = Menus.read(self.do_get_user_roots(req), ['name', 'sequence', 'parent_id', 'action'], context)
menu_roots = Menus.read(self.do_get_user_roots(req), ['name', 'sequence', 'parent_id', 'action', 'needaction_uid_ctr', 'uses_needaction'], context)
menu_root = {'id': False, 'name': 'root', 'parent_id': [-1, ''], 'children' : menu_roots}
# menus are loaded fully unlike a regular tree view, cause there are a
# limited number of items (752 when all 6.1 addons are installed)
menu_ids = Menus.search([], 0, False, False, context)
menu_items = Menus.read(menu_ids, ['name', 'sequence', 'parent_id', 'action'], context)
menu_items = Menus.read(menu_ids, ['name', 'sequence', 'parent_id', 'action', 'needaction_uid_ctr', 'uses_needaction'], context)
# adds roots at the end of the sequence, so that they will overwrite
# equivalent menu items from full menu read when put into id:item
# mapping, resulting in children being correctly set on the roots.
+11
View File
@@ -264,6 +264,17 @@
border-right: 4px solid transparent;
border-top: 4px solid #4c4c4c;
}
.oe_menu_counter {
float:right;
background: #eeeeee;
color: #8a89ba;
font-weight: bold;
border-width:1px;
padding-top:2px;
padding-right:4px;
padding-left:4px;
border-radius:2px;
}
.openerp2 .oe_dropdown {
position: relative;
}
+5
View File
@@ -368,6 +368,11 @@
t-att-data-action-model="menu.action ? menu.action.split(',')[0] : ''"
t-att-data-action-id="menu.action ? menu.action.split(',')[1] : ''">
<t t-esc="menu.name"/>
<t t-if="menu.uses_needaction == true">
<div class="oe_menu_counter">
<t t-esc="menu.needaction_uid_ctr"/>
</div>
</t>
</a>
</t>