From ed023b8f81baf3cbcbdff358723f56699580af4d Mon Sep 17 00:00:00 2001 From: "Yogesh (OpenERP)" Date: Tue, 4 Oct 2011 11:31:17 +0530 Subject: [FIX] show all configuration wizard in administrator dashboard. lp bug: https://launchpad.net/bugs/865162 fixed bzr revid: ysa@tinyerp.com-20111004060117-bylyhk4ye781q33r --- addons/web_dashboard/static/src/js/dashboard.js | 1 - 1 file changed, 1 deletion(-) (limited to 'addons/web_dashboard/static/src') diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index 4672492821d..808fe64e5c7 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -292,7 +292,6 @@ openerp.web_dashboard.ConfigOverview = openerp.web.View.extend({ this._super(parent); this.dataset = new openerp.web.DataSetSearch( this, 'ir.actions.todo'); - this.dataset.domain = [['type', '=', 'manual']]; }, start: function () { this._super(); -- cgit v1.2.3 From 0f7c7cc33f4cbd689bfe7b2f339ac0d828e9b582 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Mon, 10 Oct 2011 10:58:59 +0200 Subject: [FIX] Temporary title for dashboard bzr revid: al@openerp.com-20111010085859-exioaclasc8opkd5 --- addons/web_dashboard/static/src/xml/web_dashboard.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web_dashboard/static/src') diff --git a/addons/web_dashboard/static/src/xml/web_dashboard.xml b/addons/web_dashboard/static/src/xml/web_dashboard.xml index ec89cf9f647..c78583e709c 100644 --- a/addons/web_dashboard/static/src/xml/web_dashboard.xml +++ b/addons/web_dashboard/static/src/xml/web_dashboard.xml @@ -32,6 +32,7 @@

+ ActionTitle -- cgit v1.2.3 From ca224b647cefbd752aff8f6cfacd27593ec874a8 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 10 Oct 2011 14:28:28 +0200 Subject: [FIX] Dashboard are dulicated after undo lp bug: https://launchpad.net/bugs/842808 fixed bzr revid: fme@openerp.com-20111010122828-0ra0lft4vbp2mr9s --- addons/web_dashboard/static/src/js/dashboard.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'addons/web_dashboard/static/src') diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index 4672492821d..cbf03e7044e 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -7,7 +7,7 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ this._super(view, node); this.template = 'DashBoard'; this.actions_attrs = {}; - this.action_managers = []; + this.view = view; }, start: function() { var self = this; @@ -226,10 +226,8 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ pager: false, low_profile: true }; - var am = new openerp.web.ActionManager(this); - this.action_managers.push(am); - am.appendTo($("#"+this.view.element_id + '_action_' + action.id)); - am.do_action(action); + var view_manager = new openerp.web.ViewManagerAction(this, action); + view_manager.appendTo($("#"+this.view.element_id + '_action_' + action.id)); }, render: function() { // We should start with three columns available @@ -243,12 +241,9 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ return QWeb.render(this.template, this); }, do_reload: function() { - _.each(this.action_managers, function(am) { - am.stop(); - }); - this.action_managers = []; - this.view.stop(); - this.view.start(); + var view_manager = this.view.widget_parent, + action_manager = view_manager.widget_parent; + action_manager.do_action(view_manager.action); } }); openerp.web.form.DashBoardLegacy = openerp.web.form.DashBoard.extend({ -- cgit v1.2.3 From 153f5f5890acb65f191b5e19efec491852285b6b Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 10 Oct 2011 16:28:06 +0200 Subject: [IMP] Improved dashboard action titles bzr revid: fme@openerp.com-20111010142806-63dtrwjb22uppo4z --- addons/web_dashboard/static/src/css/dashboard.css | 3 --- addons/web_dashboard/static/src/js/dashboard.js | 6 ++---- addons/web_dashboard/static/src/xml/web_dashboard.xml | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) (limited to 'addons/web_dashboard/static/src') diff --git a/addons/web_dashboard/static/src/css/dashboard.css b/addons/web_dashboard/static/src/css/dashboard.css index f317cb45e8e..174066e1b72 100644 --- a/addons/web_dashboard/static/src/css/dashboard.css +++ b/addons/web_dashboard/static/src/css/dashboard.css @@ -234,6 +234,3 @@ .openerp .oe-dashboard-action .view-manager-main-content { padding: 2px; } -.openerp .oe-dashboard-action-header .ui-icon, .openerp .oe-dashboard-action-header .oe-dashboard-action-rename { - display: none; -} diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index cbf03e7044e..f8eeef78e1e 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -43,9 +43,6 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ }); //this.$element.find('a.oe-dashboard-action-rename').live('click', this.on_rename); - this.$element.find('.oe-dashboard-action').live('mouseover mouseout', function(event) { - $(this).find('.oe-dashboard-action-header .ui-icon, .oe-dashboard-action-header .oe-dashboard-action-rename').toggle(event.type == 'mouseover'); - }); }, on_undo: function() { this.rpc('/web/view/undo_custom', { @@ -224,7 +221,8 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ views_switcher : false, action_buttons : false, pager: false, - low_profile: true + low_profile: true, + display_title: false }; var view_manager = new openerp.web.ViewManagerAction(this, action); view_manager.appendTo($("#"+this.view.element_id + '_action_' + action.id)); diff --git a/addons/web_dashboard/static/src/xml/web_dashboard.xml b/addons/web_dashboard/static/src/xml/web_dashboard.xml index c78583e709c..505cc45e027 100644 --- a/addons/web_dashboard/static/src/xml/web_dashboard.xml +++ b/addons/web_dashboard/static/src/xml/web_dashboard.xml @@ -32,7 +32,7 @@

- ActionTitle + -- cgit v1.2.3 From 5a08fd1078a23273b6d797cf41945bdf898f1109 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 10 Oct 2011 17:08:11 +0200 Subject: [IMP] Bring dashboard styling from trunk-style branch bzr revid: fme@openerp.com-20111010150811-4vdff1jcr6eqz2xq --- addons/web_dashboard/static/src/css/dashboard.css | 35 +++++++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'addons/web_dashboard/static/src') diff --git a/addons/web_dashboard/static/src/css/dashboard.css b/addons/web_dashboard/static/src/css/dashboard.css index 174066e1b72..720703879fe 100644 --- a/addons/web_dashboard/static/src/css/dashboard.css +++ b/addons/web_dashboard/static/src/css/dashboard.css @@ -7,17 +7,34 @@ } .openerp .oe-dashboard-action { margin: 0 0.5em 0.5em 0; - padding: 2px; -} -.openerp .oe-dashboard-action:hover { - border: 1px dashed #ccc; - padding: 1px; + padding: 0px; + background-color: white; + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; } .openerp .oe-dashboard-action .oe-dashboard-action-header { - font-size: 125%; + font-size: 85%; font-weight: bold; + text-transform: uppercase; + text-indent: 10px; + vertical-align: center; + border-bottom: 1px solid #e5e5e5; + background: white url("/web/static/src/img/box-a-header-a.gif") 0% 0% repeat-x; } + +.openerp h2.oe-dashboard-action-header { + margin: 0; + padding:4px 4px; + -moz-border-radius-topleft: 3px; + -webkit-border-top-left-radius: 3px; + border-top-left-radius: 3px; + -moz-border-radius-topright: 3px; + -webkit-border-top-right-radius: 3px; + border-top-right-radius: 3px; +} + .openerp a.oe-dashboard-action-rename { float: left; padding-right: 4px; @@ -57,6 +74,12 @@ visibility: hidden; } +/* Base overwriting */ +.openerp .oe-listview-content, .openerp .ui-widget-header { + border:none !important; + padding:0px 3px; +} + /* Layouts */ .openerp .oe-dashboard-layout_1 .oe-dashboard-column.index_0 { width: 100%; -- cgit v1.2.3 From 2c55b9339d7d3f0b41ab84ad21a17b03a8e825f4 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Mon, 10 Oct 2011 23:46:34 +0200 Subject: [FIX] revert 1200 revid:fme@openerp.com-20111010150811-4vdff1jcr6eqz2xq, action manager must be used for client actions bzr revid: al@openerp.com-20111010214634-dmq7fcv840252p8t --- addons/web_dashboard/static/src/js/dashboard.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'addons/web_dashboard/static/src') diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index f8eeef78e1e..edee3e9b246 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -7,7 +7,7 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ this._super(view, node); this.template = 'DashBoard'; this.actions_attrs = {}; - this.view = view; + this.action_managers = []; }, start: function() { var self = this; @@ -224,8 +224,10 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ low_profile: true, display_title: false }; - var view_manager = new openerp.web.ViewManagerAction(this, action); - view_manager.appendTo($("#"+this.view.element_id + '_action_' + action.id)); + var am = new openerp.web.ActionManager(this); + this.action_managers.push(am); + am.appendTo($("#"+this.view.element_id + '_action_' + action.id)); + am.do_action(action); }, render: function() { // We should start with three columns available @@ -239,9 +241,12 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ return QWeb.render(this.template, this); }, do_reload: function() { - var view_manager = this.view.widget_parent, - action_manager = view_manager.widget_parent; - action_manager.do_action(view_manager.action); + _.each(this.action_managers, function(am) { + am.stop(); + }); + this.action_managers = []; + this.view.stop(); + this.view.start(); } }); openerp.web.form.DashBoardLegacy = openerp.web.form.DashBoard.extend({ -- cgit v1.2.3 From e625e7672e438e658f4e028e49a798445b0e146d Mon Sep 17 00:00:00 2001 From: "Yogesh (OpenERP)" Date: Tue, 11 Oct 2011 14:55:20 +0530 Subject: [FIX] Configuration wizard display only type is manual and once. bzr revid: ysa@tinyerp.com-20111011092520-wzptl5t2titcp052 --- addons/web_dashboard/static/src/js/dashboard.js | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web_dashboard/static/src') diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index 808fe64e5c7..66d7b69c891 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -292,6 +292,7 @@ openerp.web_dashboard.ConfigOverview = openerp.web.View.extend({ this._super(parent); this.dataset = new openerp.web.DataSetSearch( this, 'ir.actions.todo'); + this.dataset.domain = [['type', '!=', 'automatic']]; }, start: function () { this._super(); -- cgit v1.2.3 From d3f57c94b50b18094aab42e72a1c207ab6e29806 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 11 Oct 2011 13:29:11 +0200 Subject: [FIX] Fixed dashboard css global selector bzr revid: fme@openerp.com-20111011112911-adsysz0m5nazh5yr --- addons/web_dashboard/static/src/css/dashboard.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web_dashboard/static/src') diff --git a/addons/web_dashboard/static/src/css/dashboard.css b/addons/web_dashboard/static/src/css/dashboard.css index 720703879fe..e3178c58a4a 100644 --- a/addons/web_dashboard/static/src/css/dashboard.css +++ b/addons/web_dashboard/static/src/css/dashboard.css @@ -75,7 +75,7 @@ } /* Base overwriting */ -.openerp .oe-listview-content, .openerp .ui-widget-header { +.openerp .oe-dashboard .oe-listview-content, .openerp .oe-dashboard .ui-widget-header { border:none !important; padding:0px 3px; } -- cgit v1.2.3 From b49b1cfb104e85922666ccd567a4fa8d131a83be Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 11 Oct 2011 17:59:50 +0200 Subject: [IMP] Dashboard: use parent's do_action bzr revid: fme@openerp.com-20111011155950-z620hv2zxtccm501 --- addons/web_dashboard/static/src/js/dashboard.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'addons/web_dashboard/static/src') diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index adcf91fd06c..24b3a2339fd 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -214,6 +214,8 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ }); }, on_load_action: function(result) { + var self = this; + var action_orig = _.extend({}, result.result); var action = result.result; action.flags = { search_view : false, @@ -228,6 +230,14 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ this.action_managers.push(am); am.appendTo($("#"+this.view.element_id + '_action_' + action.id)); am.do_action(action); + am.do_action = function(action) { + self.do_action(action); + } + if (am.inner_viewmanager) { + am.inner_viewmanager.on_mode_switch.add(function(mode) { + self.do_action(action_orig); + }); + } }, render: function() { // We should start with three columns available @@ -241,12 +251,10 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ return QWeb.render(this.template, this); }, do_reload: function() { - _.each(this.action_managers, function(am) { - am.stop(); - }); - this.action_managers = []; + var view_manager = this.view.widget_parent, + action_manager = view_manager.widget_parent; this.view.stop(); - this.view.start(); + action_manager.do_action(view_manager.action); } }); openerp.web.form.DashBoardLegacy = openerp.web.form.DashBoard.extend({ -- cgit v1.2.3 From 511e9a0ea48a0fd2f4868d05384aa19e6c3c5d23 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Wed, 12 Oct 2011 01:36:27 +0200 Subject: [IMP] merged application tile with default home bzr revid: al@openerp.com-20111011233627-6nxfbs64lwzszh7t --- addons/web_dashboard/static/src/css/dashboard.css | 43 +++++ .../static/src/img/installer_account_voucher.png | Bin 0 -> 9306 bytes .../web_dashboard/static/src/img/installer_crm.png | Bin 0 -> 7323 bytes .../web_dashboard/static/src/img/installer_hr.png | Bin 0 -> 8676 bytes .../static/src/img/installer_knowledge.png | Bin 0 -> 7157 bytes .../static/src/img/installer_marketing.png | Bin 0 -> 3247 bytes .../web_dashboard/static/src/img/installer_mrp.png | Bin 0 -> 5663 bytes .../static/src/img/installer_point_of_sale.png | Bin 0 -> 7600 bytes .../static/src/img/installer_profile_tools.png | Bin 0 -> 8466 bytes .../static/src/img/installer_project.png | Bin 0 -> 4172 bytes .../static/src/img/installer_purchase.png | Bin 0 -> 5863 bytes .../static/src/img/installer_sale.png | Bin 0 -> 8685 bytes .../static/src/img/installer_stock.png | Bin 0 -> 5505 bytes addons/web_dashboard/static/src/js/dashboard.js | 176 +++++++++++++++++---- .../web_dashboard/static/src/xml/web_dashboard.xml | 32 ++++ 15 files changed, 224 insertions(+), 27 deletions(-) create mode 100644 addons/web_dashboard/static/src/img/installer_account_voucher.png create mode 100644 addons/web_dashboard/static/src/img/installer_crm.png create mode 100644 addons/web_dashboard/static/src/img/installer_hr.png create mode 100644 addons/web_dashboard/static/src/img/installer_knowledge.png create mode 100644 addons/web_dashboard/static/src/img/installer_marketing.png create mode 100644 addons/web_dashboard/static/src/img/installer_mrp.png create mode 100644 addons/web_dashboard/static/src/img/installer_point_of_sale.png create mode 100644 addons/web_dashboard/static/src/img/installer_profile_tools.png create mode 100644 addons/web_dashboard/static/src/img/installer_project.png create mode 100644 addons/web_dashboard/static/src/img/installer_purchase.png create mode 100644 addons/web_dashboard/static/src/img/installer_sale.png create mode 100644 addons/web_dashboard/static/src/img/installer_stock.png (limited to 'addons/web_dashboard/static/src') diff --git a/addons/web_dashboard/static/src/css/dashboard.css b/addons/web_dashboard/static/src/css/dashboard.css index e3178c58a4a..4d48cd4ffbd 100644 --- a/addons/web_dashboard/static/src/css/dashboard.css +++ b/addons/web_dashboard/static/src/css/dashboard.css @@ -257,3 +257,46 @@ .openerp .oe-dashboard-action .view-manager-main-content { padding: 2px; } + +.oe-static-home { + padding: 0.5em 0.5em; + text-align: center; +} +.oe-static-home h1 { + margin: 0 0 0.3em +} +.oe-static-home-banner { + display: inline-block; + margin: auto 0; + padding: 0.5em 5em; + text-align: left; +} +.oe-static-home-banner li { + font-size: 150%; + font-weight: bold; +} +.oe-static-home address { + font-style: normal; + padding-left: 2em; +} + +.oe-static-home-tiles { + text-align: left; +} +.oe-static-home-tiles td { + vertical-align: top; +} +.oe-static-home-tile { + margin: 0.5em; + padding: 0 1em; +} +.oe-static-home-tile-logo { + margin-right: 0.5em; +} +.oe-static-home-tile-text h2 { + margin-top: 0; + margin-bottom: 0.2em; +} +.oe-static-home-tile-text p { + margin: 0.5em 0; +} diff --git a/addons/web_dashboard/static/src/img/installer_account_voucher.png b/addons/web_dashboard/static/src/img/installer_account_voucher.png new file mode 100644 index 00000000000..afad1331e2e Binary files /dev/null and b/addons/web_dashboard/static/src/img/installer_account_voucher.png differ diff --git a/addons/web_dashboard/static/src/img/installer_crm.png b/addons/web_dashboard/static/src/img/installer_crm.png new file mode 100644 index 00000000000..893bb23ab98 Binary files /dev/null and b/addons/web_dashboard/static/src/img/installer_crm.png differ diff --git a/addons/web_dashboard/static/src/img/installer_hr.png b/addons/web_dashboard/static/src/img/installer_hr.png new file mode 100644 index 00000000000..742f3e53e67 Binary files /dev/null and b/addons/web_dashboard/static/src/img/installer_hr.png differ diff --git a/addons/web_dashboard/static/src/img/installer_knowledge.png b/addons/web_dashboard/static/src/img/installer_knowledge.png new file mode 100644 index 00000000000..78864367df1 Binary files /dev/null and b/addons/web_dashboard/static/src/img/installer_knowledge.png differ diff --git a/addons/web_dashboard/static/src/img/installer_marketing.png b/addons/web_dashboard/static/src/img/installer_marketing.png new file mode 100644 index 00000000000..cfe890f31be Binary files /dev/null and b/addons/web_dashboard/static/src/img/installer_marketing.png differ diff --git a/addons/web_dashboard/static/src/img/installer_mrp.png b/addons/web_dashboard/static/src/img/installer_mrp.png new file mode 100644 index 00000000000..600104af507 Binary files /dev/null and b/addons/web_dashboard/static/src/img/installer_mrp.png differ diff --git a/addons/web_dashboard/static/src/img/installer_point_of_sale.png b/addons/web_dashboard/static/src/img/installer_point_of_sale.png new file mode 100644 index 00000000000..9054576f2d5 Binary files /dev/null and b/addons/web_dashboard/static/src/img/installer_point_of_sale.png differ diff --git a/addons/web_dashboard/static/src/img/installer_profile_tools.png b/addons/web_dashboard/static/src/img/installer_profile_tools.png new file mode 100644 index 00000000000..d6ba0866777 Binary files /dev/null and b/addons/web_dashboard/static/src/img/installer_profile_tools.png differ diff --git a/addons/web_dashboard/static/src/img/installer_project.png b/addons/web_dashboard/static/src/img/installer_project.png new file mode 100644 index 00000000000..20ba49f07c8 Binary files /dev/null and b/addons/web_dashboard/static/src/img/installer_project.png differ diff --git a/addons/web_dashboard/static/src/img/installer_purchase.png b/addons/web_dashboard/static/src/img/installer_purchase.png new file mode 100644 index 00000000000..094705cecc3 Binary files /dev/null and b/addons/web_dashboard/static/src/img/installer_purchase.png differ diff --git a/addons/web_dashboard/static/src/img/installer_sale.png b/addons/web_dashboard/static/src/img/installer_sale.png new file mode 100644 index 00000000000..072570bae38 Binary files /dev/null and b/addons/web_dashboard/static/src/img/installer_sale.png differ diff --git a/addons/web_dashboard/static/src/img/installer_stock.png b/addons/web_dashboard/static/src/img/installer_stock.png new file mode 100644 index 00000000000..a70ccfe18d5 Binary files /dev/null and b/addons/web_dashboard/static/src/img/installer_stock.png differ diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index 24b3a2339fd..3163453a122 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -2,6 +2,11 @@ openerp.web_dashboard = function(openerp) { var QWeb = openerp.web.qweb; QWeb.add_template('/web_dashboard/static/src/xml/web_dashboard.xml'); +if (!openerp.web_dashboard) { + /** @namespace */ + openerp.web_dashboard = {}; +} + openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ init: function(view, node) { this._super(view, node); @@ -285,13 +290,12 @@ openerp.web.form.widgets.add('hpaned', 'openerp.web.form.DashBoardLegacy'); openerp.web.form.widgets.add('vpaned', 'openerp.web.form.DashBoardLegacy'); openerp.web.form.widgets.add('board', 'openerp.web.form.DashBoard'); -openerp.web.client_actions.add( - 'board.config.overview', 'openerp.web_dashboard.ConfigOverview' -); -if (!openerp.web_dashboard) { - /** @namespace */ - openerp.web_dashboard = {}; -} +/* + * ConfigOverview + * This client action designed to be used as a dashboard widget display + * ir.actions.todo in a fancy way + */ +openerp.web.client_actions.add( 'board.config.overview', 'openerp.web_dashboard.ConfigOverview'); openerp.web_dashboard.ConfigOverview = openerp.web.View.extend({ template: 'ConfigOverview', init: function (parent) { @@ -354,35 +358,152 @@ openerp.web_dashboard.ConfigOverview = openerp.web.View.extend({ } }); -openerp.web.client_actions.add( - 'board.home.applications', 'openerp.web_dashboard.ApplicationTiles'); +/* + * ApplicationTiles + * This client action designed to be used as a dashboard widget display + * either a list of application to install (if none is installed yet) or + * a list of root menu + */ +openerp.web.client_actions.add( 'board.home.applications', 'openerp.web_dashboard.ApplicationTiles'); +openerp.web_dashboard.apps = { + applications: [ + [ + { + module: 'crm', name: 'CRM', + help: "Acquire leads, follow opportunities, manage prospects and phone calls, \u2026" + }, { + module: 'sale', name: 'Sales', + help: "Do quotations, follow sales orders, invoice and control deliveries" + }, { + module: 'account_voucher', name: 'Invoicing', + help: "Send invoice, track payments and reminders" + }, { + module: 'project', name: 'Projects', + help: "Manage projects, track tasks, invoice task works, follow issues, \u2026" + } + ], [ + { + module: 'purchase', name: 'Purchase', + help: "Do purchase orders, control invoices and reception, follow your suppliers, \u2026" + }, { + module: 'stock', name: 'Warehouse', + help: "Track your stocks, schedule product moves, manage incoming and outgoing shipments, \u2026" + }, { + module: 'hr', name: 'Human Resources', + help: "Manage employees and their contracts, follow laves, recruit people, \u2026" + }, { + module: 'point_of_sale', name: 'Point of Sales', + help: "Manage shop sales, use touch-screen POS" + } + ], [ + { + module: 'profile_tools', name: 'Extra Tools', + help: "Track ideas, manage lunch, create surveys, share data" + }, { + module: 'mrp', name: 'Manufacturing', + help: "Manage your manufacturing, control your supply chain, personalize master data, \u2026" + }, { + module: 'marketing', name: 'Marketing', + help: "Manage campaigns, follow activities, automate emails, \u2026" + }, { + module: 'knowledge', name: 'Knowledge', + help: "Track your documents, browse your files, \u2026" + } + ] + ] +}; openerp.web_dashboard.ApplicationTiles = openerp.web.View.extend({ template: 'ApplicationTiles', start: function () { + var self = this; this._super(); + // Check for installed application + var Installer = new openerp.web.DataSet(this, 'base.setup.installer'); + Installer.call('default_get', [], function (installed_modules) { + var installed = false; + _.each(installed_modules, function(v,k) { + if(_.startsWith(k,"cat")) { + installed =installed || v; + } + }); + if(installed) { + self.do_display_root_menu(); + } else { + self.do_display_installer(); + } + } ); + }, + do_display_root_menu: function() { + var self = this; + var dss = new openerp.web.DataSetSearch( this, 'ir.ui.menu', null, [['parent_id', '=', false]]); + var r = dss.read_slice( ['name', 'web_icon_data', 'web_icon_hover_data'], {}, function (applications) { + // Create a matrix of 3*x applications + var rows = []; + while (applications.length) { + rows.push(applications.splice(0, 3)); + } + var tiles = QWeb.render( 'ApplicationTiles.content', {rows: rows}); + self.$element.append(tiles) + .find('.oe-dashboard-home-tile') + .click(function () { + var $this = $(this); + $this.closest('.openerp') + .find('.menu a[data-menu=' + $this.data('menuid') + ']') + .click();}); + }); + return r; + }, + do_display_installer: function() { + var self = this; + var render_ctx = { + url: window.location.protocol + '//' + window.location.host + window.location.pathname, + session: self.session, + rows: openerp.web_dashboard.apps.applications + }; + var installer = QWeb.render('StaticHome', render_ctx); + self.$element.append(installer); + this.$element.delegate('.oe-static-home-tile-text button', 'click', function () { + self.install_module($(this).val()); + }); + }, + install_module: function (module_name) { var self = this; - return new openerp.web.DataSetSearch( - this, 'ir.ui.menu', null, [['parent_id', '=', false]]) - .read_slice( ['name', 'web_icon_data', 'web_icon_hover_data'], {}, function (applications) { - // Create a matrix of 3*x applications - var rows = []; - while (applications.length) { - rows.push(applications.splice(0, 3)); + var Modules = new openerp.web.DataSetSearch( + this, 'ir.module.module', null, + [['name', '=', module_name], ['state', '=', 'uninstalled']]); + var Upgrade = new openerp.web.DataSet(this, 'base.module.upgrade'); + + $.blockUI({message:''}); + Modules.read_slice(['id'], {}, function (records) { + if (!(records.length === 1)) { $.unblockUI(); return; } + Modules.call('state_update', + [_.pluck(records, 'id'), 'to install', ['uninstalled']], + function () { + Upgrade.call('upgrade_module', [[]], function () { + self.run_configuration_wizards(); + }); } - self.$element - .append(QWeb.render( - 'ApplicationTiles.content', {rows: rows})) - .find('.oe-dashboard-home-tile') - .click(function () { - var $this = $(this); - $this.closest('.openerp') - .find('.menu a[data-menu=' + $this.data('menuid') + ']') - .click();}); + ) + }); + }, + run_configuration_wizards: function () { + var self = this; + new openerp.web.DataSet(this, 'res.config').call('start', [[]], function (action) { + $.unblockUI(); + self.do_action(action, function () { + // TODO: less brutal reloading + window.location.reload(true); }); + }); } }); -openerp.web.client_actions.add( - 'board.home.widgets', 'openerp.web_dashboard.Widget'); + +/* + * Widgets + * This client action designed to be used as a dashboard widget display + * the html content of a res_widget given as argument + */ +openerp.web.client_actions.add( 'board.home.widgets', 'openerp.web_dashboard.Widget'); openerp.web_dashboard.Widget = openerp.web.View.extend(/** @lends openerp.web_dashboard.Widgets# */{ template: 'HomeWidget', /** @@ -416,4 +537,5 @@ openerp.web_dashboard.Widget = openerp.web.View.extend(/** @lends openerp.web_da })); } }); + }; diff --git a/addons/web_dashboard/static/src/xml/web_dashboard.xml b/addons/web_dashboard/static/src/xml/web_dashboard.xml index 505cc45e027..fe96d72855d 100644 --- a/addons/web_dashboard/static/src/xml/web_dashboard.xml +++ b/addons/web_dashboard/static/src/xml/web_dashboard.xml @@ -111,4 +111,36 @@