summaryrefslogtreecommitdiff
path: root/addons/base_export/static/src
diff options
context:
space:
mode:
authorYogesh (OpenERP) <ysa@tinyerp.com>2011-07-22 16:12:02 +0530
committerYogesh (OpenERP) <ysa@tinyerp.com>2011-07-22 16:12:02 +0530
commit2401a12148f8db8a1f83bb256c3513d3d720c7d8 (patch)
treede13b0ae6fe6b15b04b9c640bb64750150b5bb8f /addons/base_export/static/src
parentbd53153386ed78523880acd104b2f8b3b73b06cb (diff)
[IMP] implement export in excel and csv file.
bzr revid: ysa@tinyerp.com-20110722104202-d8suf02qsfi9c29w
Diffstat (limited to 'addons/base_export/static/src')
-rw-r--r--addons/base_export/static/src/js/base_export.js6
-rw-r--r--addons/base_export/static/src/xml/base_export.xml14
2 files changed, 15 insertions, 5 deletions
diff --git a/addons/base_export/static/src/js/base_export.js b/addons/base_export/static/src/js/base_export.js
index ce2a385bdc9..8814edc946b 100644
--- a/addons/base_export/static/src/js/base_export.js
+++ b/addons/base_export/static/src/js/base_export.js
@@ -373,8 +373,10 @@ openerp.base_export.Export = openerp.base.Dialog.extend({
}
import_comp = $("#import_compat option:selected").val()
- self.rpc("/base_export/export/export_data", {"model": self.dataset.model, "fields":export_field, 'ids': self.dataset.ids, 'domain': self.dataset.domain, "import_compat":parseInt(import_comp)}, function(data){
- window.location="data:text/csv;charset=utf8," + encodeURIComponent(data)
+ export_format = $("#export_format").val()
+
+ self.rpc("/base_export/export/export_data", {"model": self.dataset.model, "fields":export_field, 'ids': self.dataset.ids, 'domain': self.dataset.domain, "import_compat":parseInt(import_comp), "export_format" :export_format}, function(data){
+ window.location="data:text/csv/excel;charset=utf8," + data
self.close();
});
},
diff --git a/addons/base_export/static/src/xml/base_export.xml b/addons/base_export/static/src/xml/base_export.xml
index 9860e4d068d..74fd260ac2e 100644
--- a/addons/base_export/static/src/xml/base_export.xml
+++ b/addons/base_export/static/src/xml/base_export.xml
@@ -16,13 +16,21 @@
<td>
<table>
<tr>
- <td class="label"><label for="import_compat">Export Type:</label></td>
+ <td class="label"><label>Export Type:</label></td>
<td>
<select id="import_compat" name="import_compat" style="background-color: #F3F3F3;" >
<option value="1">Import Compatible Export</option>
<option value="0">Export all Data</option>
</select>
</td>
+ <td class="label"><label>Export Format</label></td>
+ <td>
+ <select id="export_format" name="export_format">
+ <option value="csv">CSV</option>
+ <option value="xls">Excel</option>
+ </select>
+ </td>
+
</tr>
</table>
</td>
@@ -114,7 +122,7 @@
<tr>
<th><label>Save as:</label></th>
<td><input size="10" type="text" id="savelist_name"/></td>
- <td><button id="add_export_list">Ok</button></td>
+ <td><button class="button-export" id="add_export_list">Ok</button></td>
</tr>
</t>
@@ -129,7 +137,7 @@
</t>
</select>
</td>
- <td><button id="delete_export_list">Delete</button></td>
+ <td><button class="button-export" id="delete_export_list">Delete</button></td>
</tr>
</t>
</template> \ No newline at end of file