From 2d524c947cc6ef51e1c2a40dd69a518c9586afc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Mon, 2 Feb 2015 16:22:42 +0100 Subject: [PATCH] [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. --- addons/web/static/src/js/view_list_editable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 1fa3c0831b5..11a5d884f57 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -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