From 2f5e44d40b35ea6790a5e10223273c0cbe900c87 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 18 Apr 2018 10:44:01 +0200 Subject: [PATCH] [FIX] web: checkbox in editable list are clickable Having boolean checkbox in an editable list Before this commit, the checkbox was disabled, thus not clickable The user, who probably expects to click on it to tick/untick was thus misled, and needed to click *outside* the checkbox in order to activate the row and only then tick the checkbox After this commit, the behavior is as expected from the editable list point of view clicking anywhere in the row (inlcuding on the checkbox itself) activates it into editable mode OPW 1836067 closes #24292 --- .../static/src/js/views/list/list_editable_renderer.js | 7 ++++++- addons/web/static/src/less/list_view.less | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views/list/list_editable_renderer.js b/addons/web/static/src/js/views/list/list_editable_renderer.js index 64cfa8a1f30..09908212237 100644 --- a/addons/web/static/src/js/views/list/list_editable_renderer.js +++ b/addons/web/static/src/js/views/list/list_editable_renderer.js @@ -531,8 +531,13 @@ ListRenderer.include({ * @returns {Deferred} this deferred is resolved immediately */ _renderView: function () { + var self = this; this.currentRow = null; - return this._super.apply(this, arguments); + return this._super.apply(this, arguments).then(function () { + if (self._isEditable()) { + self.$('table').addClass('o_editable_list'); + } + }); }, /** * Force the resequencing of the items in the list. diff --git a/addons/web/static/src/less/list_view.less b/addons/web/static/src/less/list_view.less index 874e809071b..1b1c57b339f 100644 --- a/addons/web/static/src/less/list_view.less +++ b/addons/web/static/src/less/list_view.less @@ -6,6 +6,14 @@ background-color: @odoo-view-background-color; margin-bottom: 0px; + // Checkbox in editable list + // should be clickable and activate the row + &.o_editable_list .o_data_row:not(.o_selected_row) .o_data_cell { + .o_checkbox:not(.o_readonly_modifier) { + pointer-events: none; + } + } + &.table { td, th { vertical-align: middle;