summaryrefslogtreecommitdiff
path: root/addons/base
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2011-03-28 16:19:20 +0200
committerXavier Morel <xmo@openerp.com>2011-03-28 16:19:20 +0200
commite7860c7e63dd2b1db6b623ebcf532a34ea9bbb2f (patch)
tree51a6b26c436a8ea151c36cc336b3cb3156aba84b /addons/base
parentfd9da7558ad14c8d489369427532ea8ee15110fa (diff)
[IMP] use non-literal domains to and from client, add a bunch of tests
Converted OpenERPSession's evaluations to be based on literal (dict) or nonliteral (Domain) objects. OpenERPSession will *not accept* to eval strings bzr revid: xmo@openerp.com-20110328141920-hlp6sb173o2j6ldw
Diffstat (limited to 'addons/base')
-rw-r--r--addons/base/controllers/main.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/addons/base/controllers/main.py b/addons/base/controllers/main.py
index 6752ea8c7d7..7981c717324 100644
--- a/addons/base/controllers/main.py
+++ b/addons/base/controllers/main.py
@@ -21,7 +21,8 @@ class Xml2Json:
# URL: http://code.google.com/p/xml2json-direct/
@staticmethod
def convert_to_json(s):
- return simplejson.dumps(Xml2Json.convert_to_structure(s), sort_keys=True, indent=4)
+ return simplejson.dumps(
+ Xml2Json.convert_to_structure(s), sort_keys=True, indent=4)
@staticmethod
def convert_to_structure(s):
@@ -174,10 +175,15 @@ class Menu(openerpweb.Controller):
actions = Values.get('action', 'tree_but_open', [('ir.ui.menu', menu_id)], False, {})
for _, _, action in actions:
+ # values come from the server, we can just eval them
action['context'] = req.session.eval_context(
action['context']) or {}
- action['domain'] = req.session.eval_domain(
- action['domain'], action['context']) or []
+
+ if isinstance(action['domain'], basestring):
+ action['domain'] = eval(
+ action['domain'],
+ req.session.evaluation_context(
+ action['context'])) or []
return {"action": actions}