summaryrefslogtreecommitdiff
path: root/addons/base_import/static/src/xml/import.xml
diff options
context:
space:
mode:
authorFrédéric van der Essen <fva@openerp.com>2012-10-17 16:05:09 +0200
committerFrédéric van der Essen <fva@openerp.com>2012-10-17 16:05:09 +0200
commitcbdb0ccf9c03fc2f9eef6b447d5c42df64ba3e4b (patch)
tree6e373389997ee6cff6273ede9a6e3a1b1c7e23e2 /addons/base_import/static/src/xml/import.xml
parent3f48855822d1532e6b6284222307b3674642cb52 (diff)
parent04eef2c7a0775a0c6c7252c990d5c691effc262e (diff)
[MERGE] from trunk
bzr revid: fva@openerp.com-20121017140509-67yq1gjzrs871hb6
Diffstat (limited to 'addons/base_import/static/src/xml/import.xml')
-rw-r--r--addons/base_import/static/src/xml/import.xml76
1 files changed, 56 insertions, 20 deletions
diff --git a/addons/base_import/static/src/xml/import.xml b/addons/base_import/static/src/xml/import.xml
index 386348bea4b..1c57c40c9db 100644
--- a/addons/base_import/static/src/xml/import.xml
+++ b/addons/base_import/static/src/xml/import.xml
@@ -2,17 +2,45 @@
<t t-name="ImportView">
<t t-set="_id" t-value="_.uniqueId('export')"/>
<form action="" method="post" enctype="multipart/form-data" class="oe_import">
+ <header>
+ <button type="button" disabled="disabled"
+ class="oe_button oe_import_button oe_import_validate oe_highlight"
+ >Validate</button>
+ <button type="button" disabled="disabled"
+ class="oe_button oe_import_button oe_import_import"
+ >Import</button>
+ <span class="oe_fade">or</span>
+ <a class="oe_import_cancel" href="#">Cancel</a>
+ </header>
<input type="hidden" name="session_id"
t-att-value="widget.session.session_id"/>
<input type="hidden" name="import_id"/>
<h2>Upload your file</h2>
- <p>Select the <a href="#" class="oe_import_csv">.CSV</a>
+ <p>Select the <a
+ href="http://en.wikipedia.org/wiki/Comma-separated_values"
+ class="oe_import_csv" target="_blank">.CSV</a>
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>
+ can use the export tool to generate one.</p>
<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"/>
+ <button type="button" class="oe_import_file_reload">
+ <img src="/web/static/src/img/icons/gtk-refresh.png"/>
+ </button>
+ <div class="oe_import_with_file">
+ <a href="#" class="oe_import_toggle">
+ File Format Options…</a>
+ <div class="oe_import_toggled oe_import_options">
+ <p t-foreach="widget.opts" t-as="option">
+ <!-- no @name, avoid submission when file_update called -->
+ <label t-attf-for="#{option.name}_#{_id}">
+ <t t-esc="option.label"/></label>
+ <input t-attf-id="#{option.name}_#{_id}"
+ t-attf-class="oe_import_#{option.name}"
+ t-att-value="option.value"/>
+ </p>
+ </div>
+ </div>
<div class="oe_import_with_file">
<h2>Map your data to OpenERP</h2>
@@ -27,18 +55,6 @@
<div class="oe_import_error_report"></div>
<table class="oe_import_grid" width="100%"/>
- <a href="#" class="oe_import_toggle">
- File Format Options…</a>
- <div class="oe_import_toggled oe_import_options">
- <p t-foreach="widget.opts" t-as="option">
- <!-- no @name, avoid submission when file_update called -->
- <label t-attf-for="#{option.name}_#{_id}">
- <t t-esc="option.label"/></label>
- <input t-attf-id="#{option.name}_#{_id}"
- t-attf-class="oe_import_#{option.name}"
- t-att-value="option.value"/>
- </p>
- </div>
<h2>Frequently Asked Questions</h2>
<dl>
@@ -81,17 +97,37 @@
</tr>
</t>
<t t-name="ImportView.preview.error">
- <p>Import preview failed due to: <t t-esc="error"/></p>
+ <p>Import preview failed due to: <t t-esc="error"/>. The issue is
+ usually an incorrect file encoding.</p>
<p>Here is the start of the file we could not import:</p>
<pre><t t-esc="preview"/></pre>
</t>
<ul t-name="ImportView.error">
- <li t-foreach="errors" t-as="error" t-attf-class="oe_import_report_#{error.type}">
- <!-- can also have error.record, but may be *huge* if
- e.g. has image fields -->
- <t t-esc="error.message"/>
+ <li t-foreach="errors" t-as="error"
+ t-attf-class="oe_import_report oe_import_report_#{error_value[0].type}">
+ <t t-call="ImportView.error.each">
+ <t t-set="error" t-value="error_value[0]"/>
+ </t>
+
+ <a href="#" class="oe_import_report_count" t-if="error_value.length gt 1">
+ <t t-esc="more(error_value.length - 1)"/>
+ </a>
+ <ul class="oe_import_report_more" t-if="error_value.length gt 1">
+ <li t-foreach="error_value.length - 1" t-as="index">
+ <t t-call="ImportView.error.each">
+ <t t-set="error" t-value="error_value[index + 1]"/>
+ </t>
+ </li>
+ </ul>
</li>
</ul>
+ <t t-name="ImportView.error.each">
+ <span class="oe_import_report_message">
+ <t t-esc="error.message"/>
+ </span>
+ <t t-if="error.rows" t-esc="at(error.rows)"/>
+ <t t-if="error.moreinfo" t-raw="info(error.moreinfo)"/>
+ </t>
<t t-extend="ListView.buttons">
<t t-jquery="span.oe_alternative">
this.attr('t-if', 'widget.options.import_enabled');