[imp] improved html generation in editable lists

bzr revid: nicolas.vanhoren@openerp.com-20120221105229-h7609f8boalmvl6q
This commit is contained in:
niv-openerp
2012-02-21 11:52:29 +01:00
parent 29b3d51d2f
commit efb48237bb
2 changed files with 4 additions and 10 deletions
@@ -237,21 +237,14 @@ openerp.web.list_editable = function (openerp) {
self.edition_id = record_id;
self.edition_form = new openerp.web.ListEditableFormView(self.view, self.dataset, false);
self.edition_form.$element = $new_row;
self.edition_form.editable_list = self;
// HO HO
// empty
$.when(self.edition_form.on_loaded(self.get_form_fields_view())).then(function () {
// put in $.when just in case FormView.on_loaded becomes asynchronous
$new_row.find('> td')
.addClass('oe-field-cell')
.removeAttr('width')
.end()
.find('td:last').removeClass('oe-field-cell').end();
if (self.options.selectable) {
$new_row.prepend('<th>');
}
if (self.options.isClarkGable) {
$new_row.prepend('<th>');
}
// pad in case of groupby
_(self.columns).each(function (column) {
if (column.meta) {
+3 -2
View File
@@ -728,6 +728,8 @@
</td>
</tr>
<t t-name="ListView.row.form">
<th t-if="widget.editable_list.options.selectable"></th>
<th t-if="widget.editable_list.options.isClarkGable"></th>
</t>
<t t-name="FormView">
@@ -1522,9 +1524,8 @@
<t t-foreach="widget.table" t-as="row">
<t t-foreach="row" t-as="td">
<td t-att-colspan="td.colspan gt 1 ? td.colspan : undefined"
t-att-width="td.width"
t-att-valign="td.table ? 'top' : undefined"
t-attf-class="oe_form_frame_cell #{td.classname} #{td.element_class}"
t-attf-class="oe_form_frame_cell #{td.classname} #{td.element_class} oe-field-cell"
>
<t t-raw="td.render()"/>
</td>