summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/view_tree.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js/view_tree.js')
-rw-r--r--addons/web/static/src/js/view_tree.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js
index 5143adb3838..34d47b92813 100644
--- a/addons/web/static/src/js/view_tree.js
+++ b/addons/web/static/src/js/view_tree.js
@@ -42,7 +42,8 @@ openerp.web.TreeView = openerp.web.View.extend(/** @lends openerp.web.TreeView#
model: this.model,
view_id: this.view_id,
view_type: "tree",
- toolbar: this.view_manager ? !!this.view_manager.sidebar : false
+ toolbar: this.view_manager ? !!this.view_manager.sidebar : false,
+ context: this.dataset.get_context()
}, this.on_loaded);
},
/**
@@ -214,17 +215,23 @@ openerp.web.TreeView = openerp.web.View.extend(/** @lends openerp.web.TreeView#
// Get details in listview
activate: function(id) {
var self = this;
+ var local_context = {
+ active_model: self.dataset.model,
+ active_id: id,
+ active_ids: [id]};
this.rpc('/web/treeview/action', {
id: id,
model: this.dataset.model,
context: new openerp.web.CompoundContext(
- this.dataset.get_context(), {
- active_model: this.dataset.model,
- active_id: id,
- active_ids: [id]})
+ this.dataset.get_context(), local_context)
}, function (actions) {
if (!actions.length) { return; }
var action = actions[0][2];
+ var c = new openerp.web.CompoundContext(local_context);
+ if (action.context) {
+ c.add(action.context);
+ }
+ action.context = c;
self.do_action(action);
});
},