summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views.js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-11-26 15:05:25 +0100
committerXavier Morel <xmo@openerp.com>2012-11-26 15:05:25 +0100
commit4a5cb1ebc478cb650a2bf33081f101e4f74bc6fe (patch)
treed439fb62effd89c2e31f9bf238c024e6b36625b2 /addons/web/static/src/js/views.js
parenteb9a1c7d55bf4b07b5e516698a3b96a3f9f43d5b (diff)
[REM] EVALPOCALYPSE PART 2: no more python-side eval
trigger an error if a nonliteral context is pushed to the server (through a new object_hook) bzr revid: xmo@openerp.com-20121126140525-ni2x5m56upss610b
Diffstat (limited to 'addons/web/static/src/js/views.js')
-rw-r--r--addons/web/static/src/js/views.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js
index efd5f890544..9fad16a58b0 100644
--- a/addons/web/static/src/js/views.js
+++ b/addons/web/static/src/js/views.js
@@ -265,6 +265,17 @@ instance.web.ActionManager = instance.web.Widget.extend({
return self.do_action(result, options);
});
}
+
+ // Ensure context & domain are evaluated and can be manipulated/used
+ if (action.context) {
+ action.context = instance.web.pyeval.eval(
+ 'context', action.context);
+ }
+ if (action.domain) {
+ action.domain = instance.web.pyeval.eval(
+ 'domain', action.domain);
+ }
+
if (!action.type) {
console.error("No type for action", action);
return $.Deferred().reject();
@@ -1081,7 +1092,8 @@ instance.web.Sidebar = instance.web.Widget.extend({
context: instance.web.pyeval.eval(
'context', additional_context)
}).done(function(result) {
- result.context = _.extend(result.context || {},
+ result.context = new instance.web.CompoundContext(
+ result.context,
additional_context);
result.flags = result.flags || {};
result.flags.new_window = true;