From 57da819cf25a848b1da358e870bd9fccb6d1f4b1 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 23 Nov 2011 23:50:03 +0100 Subject: [PATCH] [REM] Remove add widget from dashboard bzr revid: fme@openerp.com-20111123225003-6o0h3jh21s8r9uwu --- .../web_dashboard/static/src/js/dashboard.js | 56 ------------------- .../static/src/xml/web_dashboard.xml | 4 -- 2 files changed, 60 deletions(-) diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index 65f0afe41f3..9e07703f3fa 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -26,7 +26,6 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ // Events this.$element.find('.oe-dashboard-link-undo').click(this.on_undo); this.$element.find('.oe-dashboard-link-reset').click(this.on_reset); - this.$element.find('.oe-dashboard-link-add_widget').click(this.on_add_widget); this.$element.find('.oe-dashboard-link-change_layout').click(this.on_change_layout); this.$element.delegate('.oe-dashboard-column .oe-dashboard-fold', 'click', this.on_fold_action); @@ -57,61 +56,6 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ reset: true }, this.do_reload); }, - on_add_widget: function() { - var self = this; - var action_manager = new openerp.web.ActionManager(this); - var dialog = new openerp.web.Dialog(this, { - title : 'Actions', - width: 800, - height: 600, - buttons : { - Cancel : function() { - $(this).dialog('destroy'); - }, - Add : function() { - self.do_add_widget(action_manager.inner_viewmanager.views.list.controller); - $(this).dialog('destroy'); - } - } - }).start().open(); - action_manager.appendTo(dialog.$element); - action_manager.do_action({ - res_model : 'ir.actions.actions', - views : [[false, 'list']], - type : 'ir.actions.act_window', - limit : 80, - auto_search : true, - flags : { - sidebar : false, - views_switcher : false, - action_buttons : false - } - }); - // TODO: should bind ListView#select_record in order to catch record clicking - }, - do_add_widget : function(listview) { - var self = this, - actions = listview.groups.get_selection().ids, - results = [], - qdict = { view : this.view }; - // TODO: should load multiple actions at once - _.each(actions, function(aid) { - self.rpc('/web/action/load', { - action_id: aid - }, function(result) { - self.actions_attrs[aid] = { - name: aid, - string: _.str.trim(result.result.name) - }; - qdict.action = { - attrs : self.actions_attrs[aid] - }; - self.$element.find('.oe-dashboard-column:first').prepend(QWeb.render('DashBoard.action', qdict)); - self.do_save_dashboard(); - self.on_load_action(result) - }); - }); - }, on_change_layout: function() { var self = this; var qdict = { diff --git a/addons/web_dashboard/static/src/xml/web_dashboard.xml b/addons/web_dashboard/static/src/xml/web_dashboard.xml index b251006b98e..589e2f39245 100644 --- a/addons/web_dashboard/static/src/xml/web_dashboard.xml +++ b/addons/web_dashboard/static/src/xml/web_dashboard.xml @@ -9,10 +9,6 @@ Undo -