[REM] Remove add widget from dashboard
bzr revid: fme@openerp.com-20111123225003-6o0h3jh21s8r9uwu
This commit is contained in:
parent
e276386511
commit
57da819cf2
|
@ -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 = {
|
||||
|
|
|
@ -9,10 +9,6 @@
|
|||
<img src="/web/static/src/img/icons/gtk-undo.png" width="16" height="16"/>
|
||||
<span>Undo</span>
|
||||
</button>
|
||||
<button type="button" class="button oe-dashboard-link-add_widget">
|
||||
<img src="/web/static/src/img/icons/STOCK_ADD.png" width="16" height="16"/>
|
||||
<span>Add Widget</span>
|
||||
</button>
|
||||
<button type="button" class="button oe-dashboard-link-change_layout">
|
||||
<img src="/web/static/src/img/icons/gtk-edit.png" width="16" height="16"/>
|
||||
<span>Change layout</span>
|
||||
|
|
Loading…
Reference in New Issue