summaryrefslogtreecommitdiff
path: root/addons/base_import/static/src/xml/import.xml
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-08-30 14:52:32 +0200
committerXavier Morel <xmo@openerp.com>2012-08-30 14:52:32 +0200
commit302cabfccb151480895cf9bd8759701667f3a999 (patch)
treee4dd3ee357a974239ab918f6e5e50b204fb0c970 /addons/base_import/static/src/xml/import.xml
parentca6323607e4b382a3fb9f54a841f35f529267622 (diff)
[IMP] Make CSV options (quoting and separator) customizable
Also autogen input ids so labels work correctly without collision risks, and make toggling links more flexible bzr revid: xmo@openerp.com-20120830125232-d7g7s5oid4qivaq2
Diffstat (limited to 'addons/base_import/static/src/xml/import.xml')
-rw-r--r--addons/base_import/static/src/xml/import.xml22
1 files changed, 18 insertions, 4 deletions
diff --git a/addons/base_import/static/src/xml/import.xml b/addons/base_import/static/src/xml/import.xml
index bb4f1d742d5..a85f8e960c1 100644
--- a/addons/base_import/static/src/xml/import.xml
+++ b/addons/base_import/static/src/xml/import.xml
@@ -1,5 +1,6 @@
<templates>
<t t-name="ImportView">
+ <t t-set="_id" t-value="_.uniqueId('export')"/>
<form action="" method="post" enctype="multipart/form-data" class="oe_import">
<input type="hidden" name="session_id"
t-att-value="widget.session.session_id"/>
@@ -9,8 +10,9 @@
file to import. If you need a sample importable file, you
can use <a href="#" class="oe_import_export">the export
tool</a> to generate one.</p>
- <label for="csvfile" autofocus="autofocus">CSV File:</label>
- <input type="file" id="csvfile" name="file" class="oe_import_file"/>
+ <label t-attf-for="file_#{_id}" autofocus="autofocus">CSV File:</label>
+ <input type="file" id-attf-id="file_#{_id}"
+ name="file" class="oe_import_file"/>
<div class="oe_import_with_file">
<h2>Map your data to OpenERP</h2>
@@ -25,11 +27,23 @@
<div class="oe_import_error_report"></div>
<table class="oe_import_grid" width="100%"/>
- <!-- TODO: other CSV options -->
+ <a href="#" class="oe_import_toggle">
+ File Format Options…</a>
+ <div class="oe_import_toggled">
+ <!-- no @name, avoid submission when file_update called -->
+ <label t-attf-for="sep_#{_id}">Separator:</label>
+ <input t-attf-id="sep_#{_id}" class="oe_import_separator"
+ t-att-value="widget.defaults.separator"/>
+ <br/>
+ <label t-attf-for="quoting_#{_id}">Quoting:</label>
+ <input t-attf-id="quoting_#{_id}" class="oe_import_quoting"
+ t-att-value="widget.defaults.quoting"/>
+ </div>
<h2>Frequently Asked Questions</h2>
<dl>
- <dt><a href="#">Need to import data from an other application?</a></dt>
+ <dt><a href="#" class="oe_import_toggle">
+ Need to import data from an other application?</a></dt>
<dd>
<p>In order to re-create relationships between
different records, you should use the unique