Thibault Delavallée (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-need_action-tde into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-need_action-tde/+merge/100797

Revision 4124 in server added three functional fields to ``ir.ui.menu`` model :
 - ``uses_needaction``: boolean field. If the menu entry action is an 
act_window action, and if this action is related to a model that uses the 
need_action mechanism, this field is set to true. Otherwise, it is false.
 - ``needaction_uid_ctr``: integer field. If the target model uses the need 
action mechanism, this field gives the number of actions the current user has 
to perform.
 - ``needaction_record_ids``: many2many field. If the target model uses the 
need action mechanism, this field holds the ids of the record requesting the 
user to perform an action.

This revision for the web client uses the new ir.ui.menu fields to display the 
number of actions the user has to perform near menu entries.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-need_action-tde/+merge/100797
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-need_action-tde.
=== modified file 'addons/web/controllers/main.py'
--- addons/web/controllers/main.py	2012-04-02 14:00:20 +0000
+++ addons/web/controllers/main.py	2012-04-04 13:56:17 +0000
@@ -875,13 +875,13 @@
         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_enabled', 'needaction_counter'], 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_enabled', 'needaction_counter'], 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.

=== modified file 'addons/web/static/src/css/base.css'
--- addons/web/static/src/css/base.css	2012-03-28 10:04:02 +0000
+++ addons/web/static/src/css/base.css	2012-04-04 13:56:17 +0000
@@ -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;
 }

=== modified file 'addons/web/static/src/js/view_list.js'
--- addons/web/static/src/js/view_list.js	2012-03-22 11:31:42 +0000
+++ addons/web/static/src/js/view_list.js	2012-04-04 13:56:17 +0000
@@ -82,7 +82,6 @@
             }
             self.compute_aggregates();
         });
-
         this.no_leaf = false;
     },
     /**
@@ -776,7 +775,7 @@
      *
      * @constructs openerp.web.ListView.List
      * @extends openerp.web.Class
-     * 
+     *
      * @param {Object} opts display options, identical to those of :js:class:`openerp.web.ListView`
      */
     init: function (group, opts) {
@@ -1514,7 +1513,7 @@
     /**
      * @constructs Record
      * @extends openerp.web.Class
-     * 
+     *
      * @mixes Events
      * @param {Object} [data]
      */
@@ -1596,11 +1595,11 @@
      * Smarter collections, with events, very strongly inspired by Backbone's.
      *
      * Using a "dumb" array of records makes synchronization between the
-     * various serious 
+     * various serious
      *
      * @constructs Collection
      * @extends openerp.web.Class
-     * 
+     *
      * @mixes Events
      * @param {Array} [records] records to initialize the collection with
      * @param {Object} [options]

=== modified file 'addons/web/static/src/xml/base.xml'
--- addons/web/static/src/xml/base.xml	2012-03-28 10:04:02 +0000
+++ addons/web/static/src/xml/base.xml	2012-04-04 13:56:17 +0000
@@ -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.needaction_enabled">
+            <div class="oe_menu_counter">
+                <t t-esc="menu.needaction_counter"/>
+            </div>
+        </t>
     </a>
 </t>
 

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to