diff options
| author | Xavier Morel <xmo@openerp.com> | 2012-02-14 13:02:30 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2012-02-14 13:02:30 +0100 |
| commit | 2aa49acc714ef27c1c525d83b5ca2bc9800794bd (patch) | |
| tree | 18d29c2c87e45a234eae89cef5b3302fa5970c32 /addons/web/static/src | |
| parent | 50bc473ffc6f546bfdba85026977eeb88cbfa6c5 (diff) | |
[FIX] correctly evaluate and use context in logs
lp bug: https://launchpad.net/bugs/925347 fixed
bzr revid: xmo@openerp.com-20120214120230-k0yti8ap15i4zcgi
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index fa6331b5071..c26255b9e8a 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -755,16 +755,21 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner var $logs_list = $logs.find('ul').empty(); $logs.toggleClass('oe-has-more', log_records.length > cutoff); _(log_records.reverse()).each(function (record) { + var context = {}; + if (record.context) { + try { context = py.eval(record.context).toJSON(); } + catch (e) { /* TODO: what do I do now? */ } + } $(_.str.sprintf('<li><a href="#">%s</a></li>', record.name)) .appendTo($logs_list) - .delegate('a', 'click', function (e) { + .delegate('a', 'click', function () { self.do_action({ type: 'ir.actions.act_window', res_model: record.res_model, res_id: record.res_id, // TODO: need to have an evaluated context here somehow - //context: record.context, - views: [[false, 'form']] + context: context, + views: [[context.view_id || false, 'form']] }); return false; }); |
