Created
February 12, 2015 11:47
-
-
Save odony/a3cd254afde9a81a61fd to your computer and use it in GitHub Desktop.
partial patch for context propagation on tree_but_open actions in 8.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js | |
index 2f92042..380f160 100644 | |
--- a/addons/web/static/src/js/view_tree.js | |
+++ b/addons/web/static/src/js/view_tree.js | |
@@ -222,27 +222,25 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie | |
var local_context = { | |
active_model: self.dataset.model, | |
active_id: id, | |
- active_ids: [id]}; | |
+ active_ids: [id] | |
+ }; | |
+ var ctx = instance.web.pyeval.eval( | |
+ 'context', new instance.web.CompoundContext( | |
+ this.dataset.get_context(), local_context)); | |
return this.rpc('/web/treeview/action', { | |
id: id, | |
model: this.dataset.model, | |
- context: instance.web.pyeval.eval( | |
- 'context', new instance.web.CompoundContext( | |
- this.dataset.get_context(), local_context)) | |
+ context: ctx | |
}).then(function (actions) { | |
if (!actions.length) { return; } | |
var action = actions[0][2]; | |
- var c = new instance.web.CompoundContext(local_context); | |
+ var c = new instance.web.CompoundContext(local_context).set_eval_context(ctx); | |
if (action.context) { | |
c.add(action.context); | |
} | |
- return instance.web.pyeval.eval_domains_and_contexts({ | |
- contexts: [c], domains: [] | |
- }).then(function (res) { | |
- action.context = res.context; | |
- return self.do_action(action); | |
- }, null); | |
- }, null); | |
+ action.context = c; | |
+ return self.do_action(action); | |
+ }); | |
}, | |
// show & hide the contents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment