[REV] reordering broken if widget=handle
bzr revid: xmo@openerp.com-20121017102603-w70q44d5h5l1xss7
This commit is contained in:
parent
3c8a9159de
commit
8d3fd60178
|
@ -399,14 +399,10 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
||||||
*/
|
*/
|
||||||
setup_columns: function (fields, grouped) {
|
setup_columns: function (fields, grouped) {
|
||||||
var registry = instance.web.list.columns;
|
var registry = instance.web.list.columns;
|
||||||
var reorder = this.options.reorderable;
|
|
||||||
this.columns.splice(0, this.columns.length);
|
this.columns.splice(0, this.columns.length);
|
||||||
this.columns.push.apply(this.columns,
|
this.columns.push.apply(this.columns,
|
||||||
_(this.fields_view.arch.children).map(function (field) {
|
_(this.fields_view.arch.children).map(function (field) {
|
||||||
var id = field.attrs.name;
|
var id = field.attrs.name;
|
||||||
if(field.attrs.widget == 'handle' && !reorder){
|
|
||||||
field.attrs.reorderable = reorder || true;
|
|
||||||
}
|
|
||||||
return registry.for_(id, fields[id], field);
|
return registry.for_(id, fields[id], field);
|
||||||
}));
|
}));
|
||||||
if (grouped) {
|
if (grouped) {
|
||||||
|
@ -415,8 +411,9 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
||||||
}
|
}
|
||||||
|
|
||||||
this.visible_columns = _.filter(this.columns, function (column) {
|
this.visible_columns = _.filter(this.columns, function (column) {
|
||||||
return column.invisible !== '1' && !column.reorderable;
|
return column.invisible !== '1';
|
||||||
});
|
});
|
||||||
|
|
||||||
this.aggregate_columns = _(this.visible_columns).invoke('to_aggregate');
|
this.aggregate_columns = _(this.visible_columns).invoke('to_aggregate');
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -630,7 +630,7 @@
|
||||||
<input type="checkbox" class="oe_list_record_selector"/>
|
<input type="checkbox" class="oe_list_record_selector"/>
|
||||||
</th>
|
</th>
|
||||||
<t t-foreach="columns" t-as="column">
|
<t t-foreach="columns" t-as="column">
|
||||||
<th t-if="!column.meta and column.invisible !== '1' and !column.reorderable" t-att-data-id="column.id"
|
<th t-if="!column.meta and column.invisible !== '1'" t-att-data-id="column.id"
|
||||||
t-attf-class="oe_list_header_#{column.widget or column.type} #{((options.sortable and column.tag !== 'button') ? 'oe_sortable' : null)}">
|
t-attf-class="oe_list_header_#{column.widget or column.type} #{((options.sortable and column.tag !== 'button') ? 'oe_sortable' : null)}">
|
||||||
<t t-if="column.tag !== 'button'"><t t-esc="column.string"/></t>
|
<t t-if="column.tag !== 'button'"><t t-esc="column.string"/></t>
|
||||||
</th>
|
</th>
|
||||||
|
@ -683,7 +683,7 @@
|
||||||
<t t-foreach="columns" t-as="column">
|
<t t-foreach="columns" t-as="column">
|
||||||
<t t-set="number" t-value="column.type === 'integer' or column.type == 'float'"/>
|
<t t-set="number" t-value="column.type === 'integer' or column.type == 'float'"/>
|
||||||
<t t-set="modifiers" t-value="column.modifiers_for(asData)"/>
|
<t t-set="modifiers" t-value="column.modifiers_for(asData)"/>
|
||||||
<td t-if="!column.meta and column.invisible !== '1' and !column.reorderable" t-att-title="column.help"
|
<td t-if="!column.meta and column.invisible !== '1'" t-att-title="column.help"
|
||||||
t-attf-class="oe_list_field_cell oe_list_field_#{column.widget or column.type} #{number ? 'oe_number' : ''} #{column.tag === 'button' ? 'oe-button' : ''} #{modifiers.readonly ? 'oe_readonly' : ''} #{modifiers.required ? 'oe_required' : ''}"
|
t-attf-class="oe_list_field_cell oe_list_field_#{column.widget or column.type} #{number ? 'oe_number' : ''} #{column.tag === 'button' ? 'oe-button' : ''} #{modifiers.readonly ? 'oe_readonly' : ''} #{modifiers.required ? 'oe_required' : ''}"
|
||||||
t-att-data-field="column.id"
|
t-att-data-field="column.id"
|
||||||
><t t-raw="render_cell(record, column)"/></td>
|
><t t-raw="render_cell(record, column)"/></td>
|
||||||
|
|
Loading…
Reference in New Issue