[FIX] web: editable lists and read only fields bug

when the user press tab in editable list views, the focus is supposed to
go to the next cell unless it is at the last cell of the line.  in that
case, it is supposed to create a new record.

Sadly, when the last cell is readonly, this does not work.  This commit
make sure that read only fields are properly ignored when computing the
last_field state.
This commit is contained in:
Géry Debongnie 2015-02-02 16:22:42 +01:00
parent 368c674a9b
commit 2d524c947c
1 changed files with 1 additions and 1 deletions

View File

@ -650,7 +650,7 @@ openerp.web.list_editable = function (instance) {
var form = this.editor.form;
var last_field = _(form.fields_order).chain()
.map(function (name) { return form.fields[name]; })
.filter(function (field) { return field.$el.is(':visible'); })
.filter(function (field) { return field.$el.is(':visible') && !field.get('effective_readonly'); })
.last()
.value();
// tabbed from last field in form