summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-09-27 11:49:50 +0200
committerXavier Morel <xmo@openerp.com>2012-09-27 11:49:50 +0200
commit4787939773e175475c03d70c4e32fdf0eeea1097 (patch)
tree1fb5a8973665ffb6641f868a5c28cec2b34af4ce
parent4d7576393a3e0efadf639dbe9958725f76ae6f10 (diff)
[FIX] correctly transform 'get all possible values' action links to display list views as list views
bzr revid: xmo@openerp.com-20120927094950-pwlgv2kt2a0jz8ji
-rw-r--r--addons/base_import/static/src/js/import.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/addons/base_import/static/src/js/import.js b/addons/base_import/static/src/js/import.js
index ac81f89c7a9..8a73bcd5d71 100644
--- a/addons/base_import/static/src/js/import.js
+++ b/addons/base_import/static/src/js/import.js
@@ -86,9 +86,20 @@ openerp.base_import = function (instance) {
},
'click .oe_import_moreinfo_action a': function (e) {
e.preventDefault();
- // #data will parse the attribute on its own, we don't like that
+ // #data will parse the attribute on its own, we don't like
+ // that sort of things
var action = JSON.parse($(e.target).attr('data-action'));
- console.log(action);
+ // FIXME: when JS-side clean_action
+ action.views = _(action.views).map(function (view) {
+ var id = view[0], type = view[1];
+ return [
+ id,
+ type !== 'tree' ? type
+ : action.view_type === 'form' ? 'list'
+ : 'tree'
+ ];
+ });
+ this.do_action(_.extend(action, {target: 'new'}));
}
},
init: function (parent, dataset) {
@@ -329,7 +340,7 @@ openerp.base_import = function (instance) {
return '<li>'
+ _.str.escapeHTML(msg)
+ '</li>';
- }).join());
+ }).join(''));
}
// Final should be object, action descriptor
return [