[IMP] Improve code, css and template. add image file.
bzr revid: ysa@tinyerp.com-20110721051232-welyq15eoo9rhmb4
This commit is contained in:
@@ -221,5 +221,5 @@ class Export(View):
|
||||
result = modle_obj.export_data(ids, field , context).get('datas',[])
|
||||
|
||||
if not import_compat:
|
||||
field = fields.values()
|
||||
field = [val.strip() for val in fields.values()]
|
||||
return self.export_csv(req, field, result)
|
||||
|
||||
@@ -1,34 +1,27 @@
|
||||
.row {
|
||||
.row tr{
|
||||
background-color: #FFFFFF;
|
||||
font-size: 0.9em;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.row:hover {
|
||||
.row:hover{
|
||||
background-color: #F3F3F3;
|
||||
color : #4F4F4F;
|
||||
color : blue;
|
||||
}
|
||||
|
||||
.row.selected{
|
||||
background-color: #E0E0E0;
|
||||
|
||||
}
|
||||
.fields-selector-export {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.fields-selector-import {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.fields-selector-left {
|
||||
width: 45%;
|
||||
}
|
||||
|
||||
td.fields-selector-left div#fields_left {
|
||||
div#left_field_panel {
|
||||
overflow: scroll;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: 400px;
|
||||
border: solid #999999 1px;
|
||||
}
|
||||
|
||||
@@ -36,30 +29,44 @@ td.fields-selector-left div#fields_left {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
.fields-selector-center td {
|
||||
padding: 2px 3px;
|
||||
}
|
||||
|
||||
.fields-selector-center a.button-a {
|
||||
float: none;
|
||||
}
|
||||
|
||||
.fields-selector-right {
|
||||
width: 45%;
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.fields-selector-export select,
|
||||
.fields-selector-import select {
|
||||
.fields-selector-export select{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.fields-selector-export button,
|
||||
.fields-selector-import button {
|
||||
width: 100%;
|
||||
margin: 5px 0;
|
||||
.tree_header{
|
||||
border: 0.5px solid #E3E3E3;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
padding: 4px 5px;
|
||||
background: url(/base_export/static/src/img/header.gif);
|
||||
}
|
||||
|
||||
td.side_spacing {
|
||||
padding: 5px 5px 0px;
|
||||
}
|
||||
|
||||
table.tree-grid{
|
||||
border: 1px solid #E3E3E3;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
background-color:#E3E3E3;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table.tree-grid a:hover {
|
||||
color: blue;
|
||||
border: none;
|
||||
}
|
||||
|
||||
table.tree-grid a {
|
||||
color: #5F5C5C;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.button {
|
||||
border: 1px solid #006;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 80 B |
Binary file not shown.
|
After Width: | Height: | Size: 81 B |
Binary file not shown.
|
After Width: | Height: | Size: 182 B |
@@ -35,6 +35,7 @@ openerp.base_export.Export = openerp.base.Dialog.extend({
|
||||
close: function(event, ui){ self.close();}
|
||||
});
|
||||
this.on_show_exists_export_list();
|
||||
jQuery(this.$dialog).removeClass('ui-dialog-content ui-widget-content');
|
||||
$('#add_field').click(function(){
|
||||
for (var key in self.selected_fields) {
|
||||
self.add_field(key, self.selected_fields[key])
|
||||
@@ -52,9 +53,10 @@ openerp.base_export.Export = openerp.base.Dialog.extend({
|
||||
import_comp = $("#import_compat option:selected").val()
|
||||
var params = {"import_compat":parseInt(import_comp), "views_id": this.views_id}
|
||||
this.rpc("/base_export/export/get_fields", {"model": this.dataset.model, "params": params}, this.on_show_data);
|
||||
|
||||
$("#import_compat").change(function(){
|
||||
$("#fields_list option").remove();
|
||||
$("tr[id^='treerow-']").remove();
|
||||
$("#field-tree-structure").remove();
|
||||
import_comp = $("#import_compat option:selected").val();
|
||||
if(import_comp){
|
||||
var params = {"import_compat":parseInt(import_comp), "views_id": this.views_id}
|
||||
@@ -170,7 +172,7 @@ openerp.base_export.Export = openerp.base.Dialog.extend({
|
||||
}
|
||||
});
|
||||
if (is_loaded == 0) {
|
||||
if ($("tr[id='treerow-" + self.field_id +"']").find('img').attr('src') == '/base/static/src/img/expand.gif') {
|
||||
if ($("tr[id='treerow-" + self.field_id +"']").find('img').attr('src') == '/base_export/static/src/img/expand.gif') {
|
||||
if (model){
|
||||
import_comp = $("#import_compat option:selected").val()
|
||||
var params = {"import_compat":parseInt(import_comp), "views_id": this.views_id, "parent_field_type" : record['field_type']}
|
||||
@@ -193,8 +195,8 @@ openerp.base_export.Export = openerp.base.Dialog.extend({
|
||||
var self = this;
|
||||
var current_tr = $("tr[id='treerow-" + self.field_id + "']");
|
||||
if (current_tr.length >= 1){
|
||||
current_tr.find('img').attr('src','/base/static/src/img/collapse.gif');
|
||||
current_tr.after(QWeb.render('ExportTreeView-Secondary', {'fields': result}));
|
||||
current_tr.find('img').attr('src','/base_export/static/src/img/collapse.gif');
|
||||
current_tr.after(QWeb.render('ExportTreeView-Secondary.children', {'fields': result}));
|
||||
}
|
||||
else{
|
||||
$('#left_field_panel').append(QWeb.render('ExportTreeView-Secondary', {'fields': result}));
|
||||
@@ -215,7 +217,7 @@ openerp.base_export.Export = openerp.base.Dialog.extend({
|
||||
arrow = {left: 37, up: 38, right: 39, down: 40 };
|
||||
switch (keyCode) {
|
||||
case arrow.left:
|
||||
if( jQuery(this).find('img').attr('src') == '/base/static/src/img/collapse.gif'){
|
||||
if( jQuery(this).find('img').attr('src') == '/base_export/static/src/img/collapse.gif'){
|
||||
self.on_click(this.id, result);
|
||||
}
|
||||
break;
|
||||
@@ -227,7 +229,7 @@ openerp.base_export.Export = openerp.base.Dialog.extend({
|
||||
$(elem).prev().find('a').focus();
|
||||
break;
|
||||
case arrow.right:
|
||||
if( jQuery(this).find('img').attr('src') == '/base/static/src/img/expand.gif'){
|
||||
if( jQuery(this).find('img').attr('src') == '/base_export/static/src/img/expand.gif'){
|
||||
self.on_click(this.id, result);
|
||||
}
|
||||
break;
|
||||
@@ -266,10 +268,10 @@ openerp.base_export.Export = openerp.base.Dialog.extend({
|
||||
showcontent: function (id, flag) {
|
||||
var first_child = $("tr[id='treerow-" + id + "']").find('img')
|
||||
if (flag) {
|
||||
first_child.attr('src', '/base/static/src/img/expand.gif');
|
||||
first_child.attr('src', '/base_export/static/src/img/expand.gif');
|
||||
}
|
||||
else {
|
||||
first_child.attr('src', '/base/static/src/img/collapse.gif');
|
||||
first_child.attr('src', '/base_export/static/src/img/collapse.gif');
|
||||
}
|
||||
var child_field = $("tr[id^='treerow-" + id +"/']")
|
||||
var child_len = (id.split("/")).length + 1
|
||||
@@ -279,8 +281,8 @@ openerp.base_export.Export = openerp.base.Dialog.extend({
|
||||
}
|
||||
else {
|
||||
if(child_len == (child_field[i].id.split("/")).length){
|
||||
if( jQuery(child_field[i]).find('img').attr('src') == '/base/static/src/img/collapse.gif'){
|
||||
jQuery(child_field[i]).find('img').attr('src', '/base/static/src/img/expand.gif')
|
||||
if( jQuery(child_field[i]).find('img').attr('src') == '/base_export/static/src/img/collapse.gif'){
|
||||
jQuery(child_field[i]).find('img').attr('src', '/base_export/static/src/img/expand.gif')
|
||||
}
|
||||
$(child_field[i]).show();
|
||||
}
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
</t>
|
||||
|
||||
<t t-name="ExportTreeView">
|
||||
<table class="view" width="100%">
|
||||
<table class="view" style="background-color: #F3F3F3;">
|
||||
<tr>
|
||||
<td class="side_spacing" align="left">
|
||||
<td align="left">
|
||||
This wizard will export all data that matches the current search criteria to a CSV file.
|
||||
You can export all data or only the fields that can be reimported after modification.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="side_spacing">
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="label"><label for="import_compat">Export Type:</label></td>
|
||||
<td>
|
||||
<select id="import_compat" name="import_compat">
|
||||
<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>
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<table class="fields-selector-export" width="100%">
|
||||
<table class="fields-selector-export">
|
||||
<tr>
|
||||
<th class="oe_view_title" valign="bottom">Available fields</th>
|
||||
<th class="oe_view_title"></th>
|
||||
@@ -41,40 +41,30 @@
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fields-selector-left" height="400px">
|
||||
<div id="fields_left">
|
||||
<table class="fields-selector-export">
|
||||
<th class="header_title"> Name </th>
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0">
|
||||
<div id="left_field_panel"/>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<td class="fields-selector-left">
|
||||
<div id="left_field_panel">
|
||||
</div>
|
||||
</td>
|
||||
<td class="fields-selector-center">
|
||||
<table width="100%">
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<button id="add_field">Add </button>
|
||||
<button id="add_field" class="button">Add </button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<button id="remove_field">Remove </button>
|
||||
<button id="remove_field" class="button">Remove </button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<button id="remove_all_field">Remove All </button>
|
||||
<button id="remove_all_field" class="button">Remove All </button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="fields-selector-right" height="400px">
|
||||
<td class="fields-selector-right">
|
||||
<select name="fields_list" id="fields_list" multiple="multiple"></select>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -85,10 +75,16 @@
|
||||
</t>
|
||||
|
||||
<t t-name="ExportTreeView-Secondary">
|
||||
<table id="field-tree-structure" class="fields-selector-export" cellspacing="0" cellpadding="0">
|
||||
<tr><th class="tree_header"> Name </th></tr>
|
||||
<t t-call="ExportTreeView-Secondary.children"/>
|
||||
</table>
|
||||
</t>
|
||||
<t t-name="ExportTreeView-Secondary.children">
|
||||
<t t-foreach="fields" t-as="field" >
|
||||
<tr t-att-id="'treerow-' + field.id" class="row">
|
||||
<td>
|
||||
<table width="100%" border="0">
|
||||
<table class="tree-grid" border="0">
|
||||
<tr class="row">
|
||||
<t t-foreach="(field.id).split('/')" t-as="level" >
|
||||
<t t-if="(field.id).split('/')[0] != level">
|
||||
@@ -98,12 +94,12 @@
|
||||
<td valign="top" align="left" style="cursor: pointer;" width="18">
|
||||
<t t-if="(field.children).length >= 1">
|
||||
<t t-if="(field.id).split('/').length != 3">
|
||||
<img t-att-id="'parentimg-' + field.id" src="/base/static/src/img/expand.gif" width="16" height="16" border="0"/>
|
||||
<img t-att-id="'parentimg-' + field.id" src="/base_export/static/src/img/expand.gif" width="16" height="16" border="0"/>
|
||||
</t>
|
||||
</t>
|
||||
</td>
|
||||
<td valign="top" align="left" style="cursor: pointer;">
|
||||
<a t-att-id="'export-' + field.id" t-att-string="field.string" href="javascript: void(0)" style="text-decoration: none;" class="row">
|
||||
<a t-att-id="'export-' + field.id" t-att-string="field.string" href="javascript: void(0)" style="text-decoration: none;">
|
||||
<t t-esc="field.string"/>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user