[IMP] more template markup cleanup, some trivial cleanup of the python code

bzr revid: xmo@openerp.com-20110826150442-j00m8sy9jib0y6ce
This commit is contained in:
Xavier Morel 2011-08-26 17:04:42 +02:00
parent 8e68d81d30
commit 5ef387c85c
2 changed files with 86 additions and 89 deletions

View File

@ -1142,8 +1142,7 @@ class Export(View):
for index, field in enumerate(fields_order):
value = fields[field]
record = {}
if import_compat and value.get('readonly', False):
if import_compat and value.get('readonly'):
ok = False
for sl in value.get('states', {}).values():
for s in sl:
@ -1152,15 +1151,16 @@ class Export(View):
id = prefix + (prefix and '/'or '') + field
nm = name + (name and '/' or '') + value['string']
record.update(id=id, string= nm, action='javascript: void(0)',
target=None, icon=None, children=[], field_type=value.get('type',False), required=value.get('required', False))
record = {'id': id, 'string': nm, 'children': [],
'field_type': value.get('type', False),
'required': value.get('required', False)}
records.append(record)
if len(nm.split('/')) < 3 and value.get('relation', False):
if len(nm.split('/')) < 3 and value.get('relation'):
if import_compat:
ref = value.pop('relation')
cfields = self.fields_get(req, ref)
if (value['type'] == 'many2many'):
if value['type'] == 'many2many':
record['children'] = []
record['params'] = {'model': ref, 'prefix': id, 'name': nm}

View File

@ -1222,93 +1222,90 @@
<t t-name="ExportView">
<a id="exportview" href="javascript: void(0)" style="text-decoration: none;color: #3D3D3D;">Export</a>
</t>
<t t-name="ExportTreeView">
<table class="oe-export" style="background-color: #F3F3F3;">
<tr>
<td colspan="3">
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 colspan="3">
<label for="import_compat">Export Type:</label>
<select id="import_compat" name="import_compat">
<option value="1">Import Compatible Export</option>
<option value="0">Export all Data</option>
</select>
<table t-name="ExportTreeView" class="oe-export"
style="background-color: #F3F3F3;">
<tr>
<td colspan="3">
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 colspan="3">
<label for="import_compat">Export Type:</label>
<select id="import_compat" name="import_compat">
<option value="1">Import Compatible Export</option>
<option value="0">Export all Data</option>
</select>
<label for="export_format">Export Format</label>
<select id="export_format" name="export_format">
<option value="csv">CSV</option>
<option value="xls">Excel</option>
</select>
</td>
</tr>
<label for="export_format">Export Format</label>
<select id="export_format" name="export_format">
<option value="csv">CSV</option>
<option value="xls">Excel</option>
</select>
</td>
</tr>
<tr>
<th>Available fields</th>
<th/>
<th>
Fields to export
<a style="color: blue; text-decoration: none;" href="#" id="export_new_list">Save fields list</a>
<div id="savenewlist"></div>
<div id="ExistsExportList"></div>
</th>
</tr>
<tr style="height: 400px;">
<td class="oe_export_fields_selector_left">
<div id="left_field_panel">
</div>
</td>
<td class="oe_export_fields_selector_center">
<button id="add_field">Add</button>
<button id="remove_field">Remove</button>
<button id="remove_all_field">Remove All</button>
</td>
<td class="oe_export_fields_selector_right">
<select name="fields_list" id="fields_list"
multiple="multiple"></select>
</td>
</tr>
</table>
</t>
<tr>
<th>Available fields</th>
<th/>
<th>
Fields to export
<a style="color: blue; text-decoration: none;" href="#" id="export_new_list">Save fields list</a>
<div id="savenewlist"></div>
<div id="ExistsExportList"></div>
</th>
</tr>
<tr style="height: 400px;">
<td class="oe_export_fields_selector_left">
<div id="left_field_panel">
</div>
</td>
<td class="oe_export_fields_selector_center">
<button id="add_field">Add</button>
<button id="remove_field">Remove</button>
<button id="remove_all_field">Remove All</button>
</td>
<td class="oe_export_fields_selector_right">
<select name="fields_list" id="fields_list"
multiple="multiple"></select>
</td>
</tr>
</table>
<t t-name="ExportTreeView-Secondary">
<table id="field-tree-structure" class="oe_export_fields_selector_export" cellspacing="0" cellpadding="0">
<tr><th class="oe_export_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="oe_export_row">
<td>
<table class="tree_grid" border="0">
<tr class="oe_export_row">
<t t-foreach="(field.id).split('/')" t-as="level" >
<t t-if="(field.id).split('/')[0] != level">
<td width="18">&amp;nbsp;</td>
</t>
<table t-name="ExportTreeView-Secondary"
id="field-tree-structure" class="oe_export_fields_selector_export"
cellspacing="0" cellpadding="0">
<tr><th class="oe_export_tree_header"> Name </th></tr>
<t t-call="ExportTreeView-Secondary.children"/>
</table>
<tr t-name="ExportTreeView-Secondary.children"
t-foreach="fields" t-as="field"
t-att-id="'treerow-' + field.id" class="oe_export_row">
<td>
<table class="tree_grid" border="0">
<tr class="oe_export_row">
<t t-foreach="(field.id).split('/')" t-as="level" >
<t t-if="(field.id).split('/')[0] != level">
<td width="18">&amp;nbsp;</td>
</t>
</t>
<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"/>
</t>
<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"/>
</t>
</t>
</td>
<td id="tree-column" valign="middle" 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;">
<t t-esc="field.string"/>
</a>
</td>
</tr>
</table>
</td>
</tr>
</t>
</t>
</t>
</td>
<td id="tree-column" valign="middle" 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;">
<t t-esc="field.string"/>
</a>
</td>
</tr>
</table>
</td>
</tr>
<t t-name="ExportNewList">
<tr>