summaryrefslogtreecommitdiff
path: root/addons/base_import/static/src
diff options
context:
space:
mode:
Diffstat (limited to 'addons/base_import/static/src')
-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 [