From 913fa445aa2d60d9edeba55960b4afc54d1715bf 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 d8358f69865..888ff4c0559 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -649,7 +649,7 @@ 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