summaryrefslogtreecommitdiff
path: root/addons/web_dashboard/controllers.py
diff options
context:
space:
mode:
authorVidhin Mehta (OpenERP) <vme@tinyerp.com>2011-10-12 16:12:25 +0530
committerVidhin Mehta (OpenERP) <vme@tinyerp.com>2011-10-12 16:12:25 +0530
commitdf2e90a5f6aab4facd019bc2d178cfeac5c76741 (patch)
tree9ae954a94b36a033bb9e44defb60ce3571744857 /addons/web_dashboard/controllers.py
parent560206d3c43903a5bf97319f09516fdb868ae6aa (diff)
parentc6d4bea1c2e9198f07eab560677c2dd52408cf2a (diff)
[MERGE] merge with main view editor branch.
bzr revid: vme@tinyerp.com-20111012104225-yqx4xb5r0d0u3gzn
Diffstat (limited to 'addons/web_dashboard/controllers.py')
-rw-r--r--addons/web_dashboard/controllers.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/addons/web_dashboard/controllers.py b/addons/web_dashboard/controllers.py
index 37fe039366c..ebf74837899 100644
--- a/addons/web_dashboard/controllers.py
+++ b/addons/web_dashboard/controllers.py
@@ -22,7 +22,11 @@ class Widgets(openerpweb.Controller):
_cp_path = '/web_dashboard/widgets'
@openerpweb.httprequest
- def content(self, request, widget_id):
- return WIDGET_CONTENT_PATTERN % request.session.model('res.widget').read(
- [widget_id], ['content'], request.session.eval_context(request.context)
- )[0]
+ def content(self, req, widget_id):
+ Widget = req.session.model('res.widget')
+ w = Widget.read([widget_id], ['content'], req.session.eval_context(req.context))
+ if w:
+ r = WIDGET_CONTENT_PATTERN % w[0]
+ else:
+ r = "Widget unavailable"
+ return r