From 388b85c751826aefde73b9afae9d19a9f60342fa Mon Sep 17 00:00:00 2001 From: "Meera Trambadia (OpenERP)" Date: Mon, 26 Mar 2012 15:26:51 +0530 Subject: [PATCH 01/12] [IMP] base:-corrected typo-dashboard bzr revid: mtr@tinyerp.com-20120326095651-47a4xwmoun01qjp8 --- openerp/addons/base/base_menu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/base_menu.xml b/openerp/addons/base/base_menu.xml index c3ad5982f28..050b1e5adf1 100644 --- a/openerp/addons/base/base_menu.xml +++ b/openerp/addons/base/base_menu.xml @@ -28,7 +28,7 @@ /> - + From 7c354067b22a3181c4775c576d9fcc23578a6fd1 Mon Sep 17 00:00:00 2001 From: "Meera Trambadia (OpenERP)" Date: Mon, 26 Mar 2012 15:45:14 +0530 Subject: [PATCH 02/12] [IMP] account,auction,crm,document,event,hr,mrp,project_*,purchase,sale,stock:-improved the parent menu name for dashboard menus bzr revid: mtr@tinyerp.com-20120326101514-mkfubco6ngi9lzr0 --- addons/account/board_account_view.xml | 2 +- addons/auction/board_auction_view.xml | 2 +- addons/crm/board_crm_statistical_view.xml | 4 ++-- addons/document/board_document_view.xml | 2 +- addons/event/board_association_view.xml | 2 +- addons/hr/hr_board.xml | 2 +- addons/mrp/board_manufacturing_view.xml | 2 +- addons/project/board_project_view.xml | 6 +++--- addons/project_issue/board_project_issue_view.xml | 2 +- addons/project_planning/project_planning_view.xml | 4 ++-- addons/project_scrum/board_project_scrum_view.xml | 2 +- addons/purchase/board_purchase_view.xml | 2 +- addons/sale/board_sale_view.xml | 4 ++-- addons/stock/board_warehouse_view.xml | 2 +- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/addons/account/board_account_view.xml b/addons/account/board_account_view.xml index 0ec75e7b5c8..6417bb99d88 100644 --- a/addons/account/board_account_view.xml +++ b/addons/account/board_account_view.xml @@ -61,7 +61,7 @@ - + diff --git a/addons/auction/board_auction_view.xml b/addons/auction/board_auction_view.xml index cb5ed07804c..360d8f38116 100644 --- a/addons/auction/board_auction_view.xml +++ b/addons/auction/board_auction_view.xml @@ -93,7 +93,7 @@ - + - + diff --git a/addons/event/board_association_view.xml b/addons/event/board_association_view.xml index b9187227b1c..96db3db6781 100644 --- a/addons/event/board_association_view.xml +++ b/addons/event/board_association_view.xml @@ -63,7 +63,7 @@ + parent="base.menu_reporting_dashboard" sequence="25"/> - + diff --git a/addons/mrp/board_manufacturing_view.xml b/addons/mrp/board_manufacturing_view.xml index 1815c4ceb12..cb81d51d439 100644 --- a/addons/mrp/board_manufacturing_view.xml +++ b/addons/mrp/board_manufacturing_view.xml @@ -29,7 +29,7 @@ + parent="base.menu_reporting_dashboard" sequence="15"/> menu - diff --git a/addons/project_planning/project_planning_view.xml b/addons/project_planning/project_planning_view.xml index 3beb5ad39a9..d12b62dbf18 100644 --- a/addons/project_planning/project_planning_view.xml +++ b/addons/project_planning/project_planning_view.xml @@ -292,11 +292,11 @@ - + + parent="project.menu_project_dashboard"/> diff --git a/addons/project_scrum/board_project_scrum_view.xml b/addons/project_scrum/board_project_scrum_view.xml index 7d993dd90c9..924a1cbf5cc 100644 --- a/addons/project_scrum/board_project_scrum_view.xml +++ b/addons/project_scrum/board_project_scrum_view.xml @@ -98,7 +98,7 @@ diff --git a/addons/purchase/board_purchase_view.xml b/addons/purchase/board_purchase_view.xml index 74f34a45cb6..4c9e776b96b 100644 --- a/addons/purchase/board_purchase_view.xml +++ b/addons/purchase/board_purchase_view.xml @@ -5,7 +5,7 @@ + parent="base.menu_reporting_dashboard" sequence="5"/> Request for Quotations diff --git a/addons/sale/board_sale_view.xml b/addons/sale/board_sale_view.xml index 57eee7f184b..8a6caf1a849 100644 --- a/addons/sale/board_sale_view.xml +++ b/addons/sale/board_sale_view.xml @@ -30,8 +30,8 @@ - - + + diff --git a/addons/stock/board_warehouse_view.xml b/addons/stock/board_warehouse_view.xml index 5c52c6412f3..b8de9cf445e 100644 --- a/addons/stock/board_warehouse_view.xml +++ b/addons/stock/board_warehouse_view.xml @@ -68,7 +68,7 @@ - + From 7d9c9efef532530d456a13fb2cccaf41effec016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 27 Mar 2012 10:45:35 +0200 Subject: [PATCH 03/12] [FIX] hr_holidays: added a missing ']' in the domain of 'year' filter. bzr revid: tde@openerp.com-20120327084535-igmpl852p0k8wq0t --- addons/hr_holidays/hr_holidays_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 9be2b2bbb31..2fc3f99bdd3 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -12,7 +12,7 @@ - + Date: Tue, 27 Mar 2012 12:05:18 +0200 Subject: [PATCH 04/12] [FIX] Reference to legacy Widget#widget_parent bzr revid: fme@openerp.com-20120327100518-p64ada2s831exv52 --- addons/web/static/src/js/chrome.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 0aaa0398e20..4a449d1152c 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -393,7 +393,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab if (self.db_list) { self.db_list.push(self.to_object(fields)['db_name']); self.db_list.sort(); - self.widget_parent.set_db_list(self.db_list); + self.getParent().set_db_list(self.db_list); } var form_obj = self.to_object(fields); From 94c7dff4eafb5b64ae6326d31e12fda03b209b74 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 27 Mar 2012 17:13:57 +0200 Subject: [PATCH 05/12] [FIX] usage issue of py.eval: in py.js 0.4, it returns a JS object not a PY object, so .toJSON should not be called on the result bzr revid: xmo@openerp.com-20120327151357-4en4skjqb66b816c --- addons/web/static/src/js/view_form.js | 2 +- addons/web/static/src/js/view_page.js | 2 +- addons/web/static/src/js/views.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 8b1ec3098a6..b6788d979a5 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1605,7 +1605,7 @@ openerp.web.form.FieldFloat = openerp.web.form.FieldChar.extend({ init: function (view, node) { this._super(view, node); if (node.attrs.digits) { - this.digits = py.eval(node.attrs.digits).toJSON(); + this.digits = py.eval(node.attrs.digits); } else { this.digits = view.fields_view.fields[node.attrs.name].digits; } diff --git a/addons/web/static/src/js/view_page.js b/addons/web/static/src/js/view_page.js index 50cc95cdea6..1e7c570abdf 100644 --- a/addons/web/static/src/js/view_page.js +++ b/addons/web/static/src/js/view_page.js @@ -93,7 +93,7 @@ openerp.web.page = function (openerp) { init: function (view, node) { this._super(view, node); if (node.attrs.digits) { - this.digits = py.eval(node.attrs.digits).toJSON(); + this.digits = py.eval(node.attrs.digits); } else { this.digits = view.fields_view.fields[node.attrs.name].digits; } diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 5be0fad74f0..43ecc8444fc 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -763,7 +763,7 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner _(log_records.reverse()).each(function (record) { var context = {}; if (record.context) { - try { context = py.eval(record.context).toJSON(); } + try { context = py.eval(record.context); } catch (e) { /* TODO: what do I do now? */ } } $(_.str.sprintf('
  • %s
  • ', record.name)) From c86b24b4c3a7206f3725ed83200270191dfc9dd6 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 27 Mar 2012 21:32:12 +0200 Subject: [PATCH 06/12] [FIX] Add 'More...' feature to main menu bzr revid: fme@openerp.com-20120327193212-kflgwnvxp89lkqmb --- addons/web/static/src/css/base.css | 615 +++++++++++++++------------- addons/web/static/src/css/base.sass | 14 + addons/web/static/src/js/chrome.js | 29 ++ addons/web/static/src/xml/base.xml | 6 + 4 files changed, 388 insertions(+), 276 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index dab8e6070af..8bf4208ba72 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -5,279 +5,342 @@ color: #4c4c4c; font-size: 13px; background: white; - position: relative; } - .openerp2 a { - text-decoration: none; } - .openerp2 .oe_webclient { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; } - .openerp2 .oe_webclient .oe_application { - position: absolute; - top: 32px; - bottom: 0; - left: 206px; - right: 0; } - .openerp2 .oe_content_full_screen .oe_application { - top: 0; - left: 0; } - .openerp2 .oe_content_full_screen .topbar, .openerp2 .oe_content_full_screen .leftbar { - display: none; } - .openerp2 .oe_topbar { - width: 100%; - height: 31px; - border-top: solid 1px #d3d3d3; - border-bottom: solid 1px black; - background-color: #646060; - background-image: -webkit-gradient(linear, left top, left bottom, from(#646060), to(#262626)); - background-image: -webkit-linear-gradient(top, #646060, #262626); - background-image: -moz-linear-gradient(top, #646060, #262626); - background-image: -ms-linear-gradient(top, #646060, #262626); - background-image: -o-linear-gradient(top, #646060, #262626); - background-image: linear-gradient(to bottom, #646060, #262626); } - .openerp2 .oe_topbar .oe_systray { - float: right; } - .openerp2 .oe_topbar .oe_systray > div { - float: left; - padding: 0 4px 0 4px; } - .openerp2 .oe_topbar .oe_topbar_item li { - float: left; } - .openerp2 .oe_topbar .oe_topbar_item li a { - display: block; - padding: 5px 10px 7px; - line-height: 20px; - height: 20px; - color: #eeeeee; - vertical-align: top; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); } - .openerp2 .oe_topbar .oe_topbar_item li a:hover { - background: #303030; - color: white; - -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } - .openerp2 .oe_topbar .oe_topbar_item .oe_active { - background: #303030; - font-weight: bold; - color: white; - -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } - .openerp2 .oe_topbar .oe_topbar_avatar { - width: 24px; - height: 24px; - margin: -2px 2px 0 0; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; } - .openerp2 .oe_topbar .oe_topbar_avatar { - vertical-align: top; } - .openerp2 .oe_leftbar { - width: 205px; - height: 100%; - background: #f0eeee; - border-right: 1px solid #afafb6; - overflow: auto; - text-shadow: 0 1px 1px white; } - .openerp2 .oe_leftbar .oe_footer { - position: absolute; - width: 205px; - text-align: center; - bottom: 8px; } - .openerp2 a.oe_logo { - display: block; - text-align: center; - height: 70px; - line-height: 70px; } - .openerp2 a.oe_logo img { - height: 40px; - width: 157px; - margin: 14px 0; } - .openerp2 .oe_footer { - position: absolute; - width: 205px; - text-align: center; - bottom: 8px; } - .openerp2 .oe_footer a { - font-weight: 800; - font-family: serif; - font-size: 16px; - color: black; } - .openerp2 .oe_footer a span { - color: #c81010; - font-style: italic; } - .openerp2 .oe_menu { - float: left; - padding: 0; - margin: 0; } - .openerp2 .oe_menu li { - list-style-type: none; - float: left; } - .openerp2 .oe_menu a { - display: block; - padding: 5px 10px 7px; - line-height: 20px; - height: 20px; - color: #eeeeee; - vertical-align: top; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); } - .openerp2 .oe_menu a:hover { - background: #303030; - color: white; - -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } - .openerp2 .oe_menu .oe_active { - background: #303030; - font-weight: bold; - color: white; - -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } - .openerp2 .oe_secondary_menu_section { - font-weight: bold; - margin-left: 8px; - color: #8a89ba; } - .openerp2 .oe_secondary_submenu { - padding: 2px 0 8px 0; - margin: 0; - width: 100%; - display: inline-block; } - .openerp2 .oe_secondary_submenu li { - position: relative; - padding: 1px 0 1px 16px; - list-style-type: none; } - .openerp2 .oe_secondary_submenu li a { - display: block; - color: #4c4c4c; - padding: 2px 4px 2px 0; } - .openerp2 .oe_secondary_submenu li .oe_menu_label { - position: absolute; - top: 1px; - right: 1px; - font-size: 10px; - background: #8a89ba; - color: white; - padding: 2px 4px; - margin: 1px 6px 0 0; - border: 1px solid lightGray; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); - -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 .oe_active { - background: #8a89ba; - border-top: 1px solid lightGray; - border-bottom: 1px solid lightGray; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); - -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 .oe_active a { - color: white; } - .openerp2 .oe_secondary_submenu .oe_active .oe_menu_label { - background: #eeeeee; - color: #8a89ba; - text-shadow: 0 1px 1px white; - -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - -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_menu_toggler:before { - width: 0; - height: 0; - display: inline-block; - content: "&darr"; - text-indent: -99999px; - vertical-align: top; - margin-left: -8px; - margin-top: 4px; - margin-right: 4px; - border-top: 4px solid transparent; - border-bottom: 4px solid transparent; - border-left: 4px solid #4c4c4c; - filter: alpha(opacity=50); - opacity: 0.5; } - .openerp2 .oe_secondary_submenu .oe_menu_opened:before { - margin-top: 6px; - margin-left: -12px; - margin-right: 4px; - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid #4c4c4c; } - .openerp2 .oe_user_menu { - float: right; - padding: 0; - margin: 0; } - .openerp2 .oe_user_menu li { - list-style-type: none; - float: left; } - .openerp2 .oe_user_menu .oe_dropdown { - position: relative; } - .openerp2 .oe_user_menu .oe_dropdown_toggle:after { - width: 0; - height: 0; - display: inline-block; - content: "&darr"; - text-indent: -99999px; - vertical-align: top; - margin-top: 8px; - margin-left: 4px; - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid white; - filter: alpha(opacity=50); - opacity: 0.5; } - .openerp2 .oe_user_menu .oe_dropdown_options { - float: left; - background: #333333; - background: rgba(37, 37, 37, 0.9); - display: none; - position: absolute; - top: 32px; - right: -1px; - border: 0; - z-index: 900; - margin-left: 0; - margin-right: 0; - padding: 6px 0; - zoom: 1; - border-color: #999999; - border-color: rgba(0, 0, 0, 0.2); - border-style: solid; - border-width: 0 1px 1px; - -moz-border-radius: 0 0 6px 6px; - -webkit-border-radius: 0 0 6px 6px; - border-radius: 0 0 6px 6px; - -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); - -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); - -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); - -webkit-background-clip: padding-box; - -moz-background-clip: padding-box; - background-clip: padding-box; } - .openerp2 .oe_user_menu .oe_dropdown_options li { - float: none; - display: block; - background-color: none; } - .openerp2 .oe_user_menu .oe_dropdown_options li a { - display: block; - padding: 4px 15px; - clear: both; - font-weight: normal; - line-height: 18px; - color: #eeeeee; } - .openerp2 .oe_user_menu .oe_dropdown_options li a:hover { - background-color: #292929; - background-image: -webkit-gradient(linear, left top, left bottom, from(#292929), to(#191919)); - background-image: -webkit-linear-gradient(top, #292929, #191919); - background-image: -moz-linear-gradient(top, #292929, #191919); - background-image: -ms-linear-gradient(top, #292929, #191919); - background-image: -o-linear-gradient(top, #292929, #191919); - background-image: linear-gradient(to bottom, #292929, #191919); - -moz-box-shadow: none; - -webkit-box-shadow: none; - -box-shadow: none; } + position: relative; +} +.openerp2 a { + text-decoration: none; +} +.openerp2 .oe_webclient { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; +} +.openerp2 .oe_webclient .oe_application { + position: absolute; + top: 32px; + bottom: 0; + left: 206px; + right: 0; +} +.openerp2 .oe_content_full_screen .oe_application { + top: 0; + left: 0; +} +.openerp2 .oe_content_full_screen .topbar, .openerp2 .oe_content_full_screen .leftbar { + display: none; +} +.openerp2 .oe_topbar { + width: 100%; + height: 31px; + border-top: solid 1px #d3d3d3; + border-bottom: solid 1px black; + background-color: #646060; + background-image: -webkit-gradient(linear, left top, left bottom, from(#646060), to(#262626)); + background-image: -webkit-linear-gradient(top, #646060, #262626); + background-image: -moz-linear-gradient(top, #646060, #262626); + background-image: -ms-linear-gradient(top, #646060, #262626); + background-image: -o-linear-gradient(top, #646060, #262626); + background-image: linear-gradient(to bottom, #646060, #262626); +} +.openerp2 .oe_topbar .oe_systray { + float: right; +} +.openerp2 .oe_topbar .oe_systray > div { + float: left; + padding: 0 4px 0 4px; +} +.openerp2 .oe_topbar .oe_topbar_item li { + float: left; +} +.openerp2 .oe_topbar .oe_topbar_item li a { + display: block; + padding: 5px 10px 7px; + line-height: 20px; + height: 20px; + color: #eeeeee; + vertical-align: top; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); +} +.openerp2 .oe_topbar .oe_topbar_item li a:hover { + background: #303030; + color: white; + -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; +} +.openerp2 .oe_topbar .oe_topbar_item .oe_active { + background: #303030; + font-weight: bold; + color: white; + -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; +} +.openerp2 .oe_topbar .oe_topbar_avatar { + width: 24px; + height: 24px; + margin: -2px 2px 0 0; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} +.openerp2 .oe_topbar .oe_topbar_avatar { + vertical-align: top; +} +.openerp2 .oe_leftbar { + width: 205px; + height: 100%; + background: #f0eeee; + border-right: 1px solid #afafb6; + overflow: auto; + text-shadow: 0 1px 1px white; +} +.openerp2 .oe_leftbar .oe_footer { + position: absolute; + width: 205px; + text-align: center; + bottom: 8px; +} +.openerp2 a.oe_logo { + display: block; + text-align: center; + height: 70px; + line-height: 70px; +} +.openerp2 a.oe_logo img { + height: 40px; + width: 157px; + margin: 14px 0; +} +.openerp2 .oe_footer { + position: absolute; + width: 205px; + text-align: center; + bottom: 8px; +} +.openerp2 .oe_footer a { + font-weight: 800; + font-family: serif; + font-size: 16px; + color: black; +} +.openerp2 .oe_footer a span { + color: #c81010; + font-style: italic; +} +.openerp2 .oe_menu { + float: left; + padding: 0; + margin: 0; +} +.openerp2 .oe_menu li { + list-style-type: none; + float: left; +} +.openerp2 .oe_menu a { + display: block; + padding: 5px 10px 7px; + line-height: 20px; + height: 20px; + color: #eeeeee; + vertical-align: top; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); +} +.openerp2 .oe_menu a:hover { + background: #303030; + color: white; + -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; +} +.openerp2 .oe_menu .oe_active { + background: #303030; + font-weight: bold; + color: white; + -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; +} +.openerp2 .oe_menu_more_container { + position: relative; +} +.openerp2 .oe_menu_more_container .oe_menu_more { + position: absolute; + padding: 0; + background-color: #646060; + z-index: 1; + border: 1px solid black; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; +} +.openerp2 .oe_menu_more_container .oe_menu_more li { + float: none; +} +.openerp2 .oe_menu_more_container .oe_menu_more li a { + white-space: nowrap; +} +.openerp2 .oe_secondary_menu_section { + font-weight: bold; + margin-left: 8px; + color: #8a89ba; +} +.openerp2 .oe_secondary_submenu { + padding: 2px 0 8px 0; + margin: 0; + width: 100%; + display: inline-block; +} +.openerp2 .oe_secondary_submenu li { + position: relative; + padding: 1px 0 1px 16px; + list-style-type: none; +} +.openerp2 .oe_secondary_submenu li a { + display: block; + color: #4c4c4c; + padding: 2px 4px 2px 0; +} +.openerp2 .oe_secondary_submenu li .oe_menu_label { + position: absolute; + top: 1px; + right: 1px; + font-size: 10px; + background: #8a89ba; + color: white; + padding: 2px 4px; + margin: 1px 6px 0 0; + border: 1px solid lightGray; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); + -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 .oe_active { + background: #8a89ba; + border-top: 1px solid lightGray; + border-bottom: 1px solid lightGray; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); + -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 .oe_active a { + color: white; +} +.openerp2 .oe_secondary_submenu .oe_active .oe_menu_label { + background: #eeeeee; + color: #8a89ba; + text-shadow: 0 1px 1px white; + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + -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_menu_toggler:before { + width: 0; + height: 0; + display: inline-block; + content: "&darr"; + text-indent: -99999px; + vertical-align: top; + margin-left: -8px; + margin-top: 4px; + margin-right: 4px; + border-top: 4px solid transparent; + border-bottom: 4px solid transparent; + border-left: 4px solid #4c4c4c; + filter: alpha(opacity=50); + opacity: 0.5; +} +.openerp2 .oe_secondary_submenu .oe_menu_opened:before { + margin-top: 6px; + margin-left: -12px; + margin-right: 4px; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid #4c4c4c; +} +.openerp2 .oe_user_menu { + float: right; + padding: 0; + margin: 0; +} +.openerp2 .oe_user_menu li { + list-style-type: none; + float: left; +} +.openerp2 .oe_user_menu .oe_dropdown { + position: relative; +} +.openerp2 .oe_user_menu .oe_dropdown_toggle:after { + width: 0; + height: 0; + display: inline-block; + content: "&darr"; + text-indent: -99999px; + vertical-align: top; + margin-top: 8px; + margin-left: 4px; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid white; + filter: alpha(opacity=50); + opacity: 0.5; +} +.openerp2 .oe_user_menu .oe_dropdown_options { + float: left; + background: #333333; + background: rgba(37, 37, 37, 0.9); + display: none; + position: absolute; + top: 32px; + right: -1px; + border: 0; + z-index: 900; + margin-left: 0; + margin-right: 0; + padding: 6px 0; + zoom: 1; + border-color: #999999; + border-color: rgba(0, 0, 0, 0.2); + border-style: solid; + border-width: 0 1px 1px; + -moz-border-radius: 0 0 6px 6px; + -webkit-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} +.openerp2 .oe_user_menu .oe_dropdown_options li { + float: none; + display: block; + background-color: none; +} +.openerp2 .oe_user_menu .oe_dropdown_options li a { + display: block; + padding: 4px 15px; + clear: both; + font-weight: normal; + line-height: 18px; + color: #eeeeee; +} +.openerp2 .oe_user_menu .oe_dropdown_options li a:hover { + background-color: #292929; + background-image: -webkit-gradient(linear, left top, left bottom, from(#292929), to(#191919)); + background-image: -webkit-linear-gradient(top, #292929, #191919); + background-image: -moz-linear-gradient(top, #292929, #191919); + background-image: -ms-linear-gradient(top, #292929, #191919); + background-image: -o-linear-gradient(top, #292929, #191919); + background-image: linear-gradient(to bottom, #292929, #191919); + -moz-box-shadow: none; + -webkit-box-shadow: none; + -box-shadow: none; +} diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 56a735c98fd..89d4c785967 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -194,6 +194,20 @@ $colour4: #8a89ba font-weight: bold color: white @include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset) + .oe_menu_more_container + position: relative + .oe_menu_more + position: absolute + padding: 0 + background-color: #646060 + z-index: 1 + border: 1px solid black + border-bottom-left-radius: 5px + border-bottom-right-radius: 5px + li + float: none + a + white-space: nowrap .oe_secondary_menu_section font-weight: bold margin-left: 8px diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 4a449d1152c..25d41c37257 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -635,11 +635,13 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ init: function() { this._super.apply(this, arguments); this.has_been_loaded = $.Deferred(); + this.maximum_visible_links = 'auto'; // # of menu to show. 0 = do not crop, 'auto' = algo }, start: function() { this._super.apply(this, arguments); this.$secondary_menus = this.getParent().$element.find('.oe_secondary_menus_container'); this.$secondary_menus.on('click', 'a[data-menu]', this.on_menu_click); + $('html').bind('click', this.do_hide_more); }, do_reload: function() { var self = this; @@ -650,14 +652,40 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ }); }, on_loaded: function(data) { + var self = this; this.data = data; this.renderElement(); + this.limit_entries(); this.$element.on('click', 'a[data-menu]', this.on_menu_click); + this.$element.on('click', 'a.oe_menu_more_link', function() { + self.$element.find('.oe_menu_more').toggle(); + return false; + }); this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this })); // Hide second level submenus this.$secondary_menus.find('.oe_menu_toggler').siblings('.oe_secondary_submenu').hide(); this.has_been_loaded.resolve(); }, + limit_entries: function() { + var maximum_visible_links = this.maximum_visible_links; + if (maximum_visible_links === 'auto') { + maximum_visible_links = this.auto_limit_entries(); + } + if (maximum_visible_links) { + var $more = $(QWeb.render('Menu.more')), + $index = this.$element.find('li').eq(maximum_visible_links - 1); + $index.after($more); + $more.find('.oe_menu_more').append($index.next().nextAll()); + } + }, + auto_limit_entries: function() { + // TODO: auto detect overflow and bind window on resize + var width = $(window).width(); + return Math.floor(width / 125); + }, + do_hide_more: function() { + this.$element.find('.oe_menu_more').hide(); + }, /** * Opens a given menu by id, as if a user had browsed to that menu by hand * except does not trigger any event on the way @@ -702,6 +730,7 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ } }, on_menu_click: function(ev, id) { + this.do_hide_more(); id = id || 0; var $clicked_menu, manual = false; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index c8a6762ab34..5b3a79391a7 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -332,6 +332,12 @@ + +
  • + More... +