[FIX] Dashboard are dulicated after undo

lp bug: https://launchpad.net/bugs/842808 fixed

bzr revid: fme@openerp.com-20111010122828-0ra0lft4vbp2mr9s
This commit is contained in:
Fabien Meghazi
2011-10-10 14:28:28 +02:00
parent a9e7199158
commit ca224b647c
2 changed files with 7 additions and 11 deletions
+1
View File
@@ -11,6 +11,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
*/
searchable: false,
form_template: "FormView",
identifier_prefix: 'formview-',
/**
* @constructs openerp.web.FormView
* @extends openerp.web.View
@@ -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({