summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2011-09-07 17:02:57 +0200
committerXavier Morel <xmo@openerp.com>2011-09-07 17:02:57 +0200
commitffa4549555f6697e22fc72c2fa9efa8cdb340eb2 (patch)
tree01ecc05962073f67c11802ce2b59701dadfe6b15
parentbc4485ef9632d26d9d9a162c96e1d26647169205 (diff)
[IMP] cleanup toolbar actions
bzr revid: xmo@openerp.com-20110907150257-ewan3jhboq0xe710
-rw-r--r--addons/web/controllers/main.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index 225e55c0591..489445deb29 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -762,6 +762,8 @@ class View(openerpweb.Controller):
fvg = Model.fields_view_get(view_id, view_type, context, toolbar, submenu)
# todo fme?: check that we should pass the evaluated context here
self.process_view(req.session, fvg, context, transform)
+ if toolbar and transform:
+ self.process_toolbar(req, fvg['toolbar'])
return fvg
def process_view(self, session, fvg, context, transform):
@@ -793,6 +795,17 @@ class View(openerpweb.Controller):
if field.get('context'):
field["context"] = self.parse_context(field["context"], session)
+ def process_toolbar(self, req, toolbar):
+ """
+ The toolbar is a mapping of section_key: [action_descriptor]
+
+ We need to clean all those actions in order to ensure correct
+ round-tripping
+ """
+ for section in toolbar.keys():
+ toolbar[section] = [clean_action(req, action)
+ for action in toolbar[section]]
+
@openerpweb.jsonrequest
def add_custom(self, req, view_id, arch):
CustomView = req.session.model('ir.ui.view.custom')