From b45b7ad22cce753a00fff13981502e2c807cee79 Mon Sep 17 00:00:00 2001
From: Xavier Morel
Date: Mon, 24 Oct 2011 16:06:58 +0200
Subject: [PATCH] [IMP] import: only show second step once file has been
uploaded
bzr revid: xmo@openerp.com-20111024140658-8t9csv9i6gd30luj
---
addons/web/controllers/main.py | 2 +-
addons/web/static/src/js/data_import.js | 2 +-
addons/web/static/src/xml/base.xml | 39 +++++++++++++------------
3 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index 8120141b4f6..6cc46b476a9 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -1412,7 +1412,7 @@ class Import(View):
return fields
@openerpweb.httprequest
- def detect_data(self, req, csvfile, csvsep, csvdel, csvcode, jsonp):
+ def detect_data(self, req, csvfile, csvsep=',', csvdel='"', csvcode='utf-8', jsonp='callback'):
try:
data = list(csv.reader(
csvfile, quotechar=str(csvdel), delimiter=str(csvsep)))
diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js
index 025ff8df1c5..42f0cf8d680 100644
--- a/addons/web/static/src/js/data_import.js
+++ b/addons/web/static/src/js/data_import.js
@@ -80,7 +80,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({
this.toggle_import_button(false);
this.$element.find('#csvfile').change(this.on_autodetect_data);
this.$element.find('fieldset').change(this.on_autodetect_data);
- this.$element.find('fieldset legend').click(function() {
+ this.$element.delegate('fieldset legend', 'click', function() {
$(this).next().toggle();
});
this.ready.push(new openerp.web.DataSet(this, this.model).call(
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 7d010d5867b..201ac964ac9 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -1419,8 +1419,27 @@
- 2. Check your file format
+
+
+
+ 2. Check your file format
+
-
-
The import failed due to: