From f8510eee62b6389e231f1b7fc76e62545f8061ed Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Fri, 30 Mar 2012 16:27:31 +0530 Subject: [PATCH 1/9] [IMP] Improved code to show need action counter bzr revid: tpa@tinyerp.com-20120330105731-ss03y3l4fi5mq3jd --- addons/web/controllers/main.py | 4 ++-- addons/web/static/src/css/base.css | 11 +++++++++++ addons/web/static/src/xml/base.xml | 5 +++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index c159929ead0..2dc1c32f88f 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -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. diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index b0a2b7945b9..3f44d6f6cda 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -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; } diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 894f7353c1a..fdef85aae5d 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -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] : ''"> + +
+ +
+
From a3a5ea21ed063492df027edb641790f8e6fa919f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 30 Mar 2012 14:59:28 +0200 Subject: [PATCH 2/9] [IMP] Propagated ir.ui.menu new fields name change. bzr revid: tde@openerp.com-20120330125928-ku9oqpb0pq4ehu6m --- addons/web/controllers/main.py | 4 ++-- addons/web/static/src/xml/base.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 2dc1c32f88f..47e02080adc 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -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', 'needaction_uid_ctr', 'uses_needaction'], 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', 'needaction_uid_ctr', 'uses_needaction'], 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. diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index fdef85aae5d..80e097e4a5e 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -368,9 +368,9 @@ t-att-data-action-model="menu.action ? menu.action.split(',')[0] : ''" t-att-data-action-id="menu.action ? menu.action.split(',')[1] : ''"> - +
- +
From cb43134c3c6b0a2aaee37fc559e6f5e067e8ca0b Mon Sep 17 00:00:00 2001 From: "Sbh (Openerp)" Date: Tue, 3 Apr 2012 16:58:16 +0530 Subject: [PATCH 3/9] [ADD]: Add the fetuare of bold font in list view bzr revid: sbh@tinyerp.com-20120403112816-qccbdf3c4alh0k2g --- addons/web/static/src/js/view_list.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index e8fff450c6e..53f66f52d76 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -82,8 +82,13 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# } self.compute_aggregates(); }); - this.no_leaf = false; + var domain = [['res_model','=', this.model]]; + new openerp.web.DataSetSearch( + this, 'ir.needaction_users_rel', this.dataset.get_context(), domain) + .read_slice().done(function(result) { + self.needaction_ids = _.pluck(result, 'res_id'); + }) }, /** * Retrieves the view's number of records per page (|| section) @@ -154,16 +159,21 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# current_date: new Date().toString('yyyy-MM-dd') // TODO: time, datetime, relativedelta }); + var style= ''; + if(this.needaction_ids.indexOf(record.attributes.id) >= 0) { + style = 'font-weight: bold;'; + } for(var i=0, len=this.colors.length; i Date: Tue, 3 Apr 2012 17:19:16 +0530 Subject: [PATCH 4/9] [IMP] set user_id bzr revid: kjo@tinyerp.com-20120403114916-6eopf4c97ivk718p --- addons/web/static/src/js/view_list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 53f66f52d76..bca01516d1a 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -83,7 +83,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# self.compute_aggregates(); }); this.no_leaf = false; - var domain = [['res_model','=', this.model]]; + var domain = [['res_model','=', this.model], ['user_id' , '=', this.session.uid]]; new openerp.web.DataSetSearch( this, 'ir.needaction_users_rel', this.dataset.get_context(), domain) .read_slice().done(function(result) { From b3c948adb0eda2f83ad62b86571d12839dbecb95 Mon Sep 17 00:00:00 2001 From: "Kuldeep Joshi (OpenERP)" Date: Wed, 4 Apr 2012 11:45:29 +0530 Subject: [PATCH 5/9] [IMP] change the class name bzr revid: kjo@tinyerp.com-20120404061529-l4lg9s74mkqzphqs --- addons/web/static/src/js/view_list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index bca01516d1a..6d95e2fa1ce 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -85,7 +85,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# this.no_leaf = false; var domain = [['res_model','=', this.model], ['user_id' , '=', this.session.uid]]; new openerp.web.DataSetSearch( - this, 'ir.needaction_users_rel', this.dataset.get_context(), domain) + this, 'ir.needaction_users', this.dataset.get_context(), domain) .read_slice().done(function(result) { self.needaction_ids = _.pluck(result, 'res_id'); }) From add39020a277778e7b32188d1bf33c7948c2682f Mon Sep 17 00:00:00 2001 From: "Sbh (Openerp)" Date: Wed, 4 Apr 2012 16:27:19 +0530 Subject: [PATCH 6/9] [REMOVE] remvoe the fetaure of bold record bzr revid: sbh@tinyerp.com-20120404105719-gmy5t4r7suedrz44 --- addons/web/static/src/js/view_list.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index e8fff450c6e..6d95e2fa1ce 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -82,8 +82,13 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# } self.compute_aggregates(); }); - this.no_leaf = false; + var domain = [['res_model','=', this.model], ['user_id' , '=', this.session.uid]]; + new openerp.web.DataSetSearch( + this, 'ir.needaction_users', this.dataset.get_context(), domain) + .read_slice().done(function(result) { + self.needaction_ids = _.pluck(result, 'res_id'); + }) }, /** * Retrieves the view's number of records per page (|| section) @@ -154,16 +159,21 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# current_date: new Date().toString('yyyy-MM-dd') // TODO: time, datetime, relativedelta }); + var style= ''; + if(this.needaction_ids.indexOf(record.attributes.id) >= 0) { + style = 'font-weight: bold;'; + } for(var i=0, len=this.colors.length; i Date: Wed, 4 Apr 2012 16:52:55 +0530 Subject: [PATCH 7/9] remove the feture of bold record bzr revid: sbh@tinyerp.com-20120404112255-hklhnejqh9s3y5d7 --- addons/web/static/src/js/view_list.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 6d95e2fa1ce..470c99c3ade 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -83,12 +83,6 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# self.compute_aggregates(); }); this.no_leaf = false; - var domain = [['res_model','=', this.model], ['user_id' , '=', this.session.uid]]; - new openerp.web.DataSetSearch( - this, 'ir.needaction_users', this.dataset.get_context(), domain) - .read_slice().done(function(result) { - self.needaction_ids = _.pluck(result, 'res_id'); - }) }, /** * Retrieves the view's number of records per page (|| section) @@ -159,21 +153,16 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# current_date: new Date().toString('yyyy-MM-dd') // TODO: time, datetime, relativedelta }); - var style= ''; - if(this.needaction_ids.indexOf(record.attributes.id) >= 0) { - style = 'font-weight: bold;'; - } for(var i=0, len=this.colors.length; i Date: Thu, 5 Apr 2012 15:42:54 +0530 Subject: [PATCH 8/9] [IMP]generated css using compiler sass bzr revid: sbh@tinyerp.com-20120405101254-35rtolfp7gjypaqg --- addons/web/static/src/css/base.css | 22 ++++++++++++++++++++++ addons/web/static/src/css/base.sass | 20 ++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index b0a2b7945b9..0554328c49e 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -220,6 +220,17 @@ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); -box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); } +.openerp2 .oe_secondary_submenu li .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_secondary_submenu .oe_active { background: #8a89ba; border-top: 1px solid lightGray; @@ -240,6 +251,17 @@ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); -box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); } +.openerp2 .oe_secondary_submenu .oe_active .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_secondary_submenu .oe_menu_toggler:before { width: 0; height: 0; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index c31f501c499..fda9e10a0f0 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -238,6 +238,16 @@ $colour4: #8a89ba text-shadow: 0 1px 1px rgba(0,0,0,0.2) @include radius(4px) @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.2)) + .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 .oe_active background: $colour4 border-top: 1px solid lightGray @@ -251,6 +261,16 @@ $colour4: #8a89ba color: $colour4 text-shadow: 0 1px 1px white @include box-shadow(0 1px 1px rgba(0, 0, 0, 0.2)) + .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 .oe_menu_toggler:before width: 0 height: 0 From 00d70016c95d7c30cfb3c00d10c5164e01491631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 5 Apr 2012 18:11:48 +0200 Subject: [PATCH 9/9] [IMP] Improved css to match more closely MIT design. bzr revid: tde@openerp.com-20120405161148-wh0vpgwalmkxffjw --- addons/web/static/src/css/base.css | 27 +++++++++++---------------- addons/web/static/src/css/base.sass | 29 +++++++++++------------------ 2 files changed, 22 insertions(+), 34 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 0554328c49e..4b47762fc58 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -220,16 +220,18 @@ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); -box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); } -.openerp2 .oe_secondary_submenu li .oe_menu_counter { +.openerp2 .oe_secondary_submenu .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; + background: #8a89ba; + color: #eeeeee; + font-size: 12px; + border: 1px solid lightgray; + padding: 0px 4px 0px 4px; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + margin: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; } .openerp2 .oe_secondary_submenu .oe_active { background: #8a89ba; @@ -252,15 +254,8 @@ -box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); } .openerp2 .oe_secondary_submenu .oe_active .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_secondary_submenu .oe_menu_toggler:before { width: 0; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index fda9e10a0f0..ba29a42b197 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -238,16 +238,16 @@ $colour4: #8a89ba text-shadow: 0 1px 1px rgba(0,0,0,0.2) @include radius(4px) @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.2)) - .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 + .oe_menu_counter + float: right + background: #8a89ba + color: #eee + font-size: 12px + border: 1px solid lightgray + padding: 0px 4px 0px 4px + text-shadow: 0 1px 1px rgba(0,0,0,0.2) + margin: 0px + @include radius(4px) .oe_active background: $colour4 border-top: 1px solid lightGray @@ -262,15 +262,8 @@ $colour4: #8a89ba text-shadow: 0 1px 1px white @include box-shadow(0 1px 1px rgba(0, 0, 0, 0.2)) .oe_menu_counter - float: right - background: #eeeeee + background: #eee color: #8a89ba - font-weight: bold - border-width: 1px - padding-top: 2px - padding-right: 4px - padding-left: 4px - border-radius: 2px .oe_menu_toggler:before width: 0 height: 0