[FIX] fix the add to dashboard widget (web client)

The dashboard widget didn't work because it tried to look for its
parent view, but the searchview has been split in searchview and drawer.
This patch makes sure it looks for the data in the correct place.
This commit is contained in:
Géry Debongnie
2014-05-30 14:34:36 +02:00
parent 803b8b0b14
commit 3bfdcfd443
+6 -8
View File
@@ -366,15 +366,13 @@ instance.board.AddToDashboard = instance.web.search.Input.extend({
},
add_dashboard: function(){
var self = this;
var getParent = this.getParent();
var view_parent = this.getParent().getParent();
if (! view_parent.action || ! this.$el.find("select").val()) {
if (! this.view.view_manager.action || ! this.$el.find("select").val()) {
this.do_warn("Can't find dashboard action");
return;
}
var data = getParent.build_search_data();
var context = new instance.web.CompoundContext(getParent.dataset.get_context() || []);
var domain = new instance.web.CompoundDomain(getParent.dataset.get_domain() || []);
var data = this.view.build_search_data();
var context = new instance.web.CompoundContext(this.view.dataset.get_context() || []);
var domain = new instance.web.CompoundDomain(this.view.dataset.get_domain() || []);
_.each(data.contexts, context.add, context);
_.each(data.domains, domain.add, domain);
@@ -394,10 +392,10 @@ instance.board.AddToDashboard = instance.web.search.Input.extend({
this.rpc('/board/add_to_dashboard', {
menu_id: this.$el.find("select").val(),
action_id: view_parent.action.id,
action_id: this.view.view_manager.action.id,
context_to_save: c,
domain: d,
view_mode: view_parent.active_view,
view_mode: this.view.view_manager.active_view,
name: this.$el.find("input").val()
}).done(function(r) {
if (r === false) {