[FIX] web: focused field in view editable list
When adding an item to the editable list, the focused field was no longer the first visible field
This is related to revision 4a508885ac
visible_columns list is not ordered
This commit is contained in:
parent
cdf87a2063
commit
893e4aae9f
|
@ -251,7 +251,10 @@ openerp.web.list_editable = function (instance) {
|
|||
}, options).then(function () {
|
||||
$recordRow.addClass('oe_edition');
|
||||
self.resize_fields();
|
||||
var focus_field = options && options.focus_field ? options.focus_field : (self.visible_columns.length ? self.visible_columns[0].name : undefined);
|
||||
var focus_field = options && options.focus_field ? options.focus_field : undefined;
|
||||
if (!focus_field){
|
||||
focus_field = _.find(self.editor.form.fields_order, function(field){ return fields[field] && fields[field].$el.is(':visible:has(input)'); });
|
||||
}
|
||||
if (focus_field) fields[focus_field].$el.find('input').select();
|
||||
return record.attributes;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue