diff options
| author | Xavier Morel <xmo@odoo.com> | 2015-01-13 17:43:18 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2015-01-14 13:28:23 +0100 |
| commit | 8c3d71ccb88950ecc5741c76e7217e478e2f2988 (patch) | |
| tree | b6c69a1ecab9ee0e95b6eef35c6233428f411ce9 /addons/web/static/src/js | |
| parent | c5929c3f16a091fc5b489d97903bce50547ce8dc (diff) | |
[CHG] Fix task 7536 / PR #499 differently
Issue was the propagation of contextual values across actions, more
precisely conserving the selected fiscal year when selecting an account
from the chart of accounts tree view: the chart of accounts tree view is
generally opened for a specific fiscal year, and it seemed sensible that
opening an account would show only the journal items for the previously
selected fiscal years rather than all items ever.
PR #649 altered action.read by tentatively evaluating the action's
context, however this has the side-effect of providing evaluated
contexts when creating or editing actions via the UI, usually breaking
them in the process (as the context at this point is basically
nonsensical for the action's purpose).
This backs out the previous fix, and creates a fix restricted to the
tree view's JS (thereby removing the feature for window actions not
invoked from a tree view).
closes #4677, closes #4690
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/view_tree.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js index 2f92042c4d0..380f1609a33 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 |
