diff options
| author | Antony Lesuisse <al@openerp.com> | 2011-10-12 01:36:27 +0200 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2011-10-12 01:36:27 +0200 |
| commit | 511e9a0ea48a0fd2f4868d05384aa19e6c3c5d23 (patch) | |
| tree | 58133382f4d21c72aa9d71808745ee9acb00ce0d /addons/web_dashboard/controllers.py | |
| parent | 9f840d08b6660de4a5ec75b4ea5a0cc1e47b1fb3 (diff) | |
[IMP] merged application tile with default home
bzr revid: al@openerp.com-20111011233627-6nxfbs64lwzszh7t
Diffstat (limited to 'addons/web_dashboard/controllers.py')
| -rw-r--r-- | addons/web_dashboard/controllers.py | 12 |
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 |
