From b5971e417f304306a3be4d8bd0b1fe85ec381c1d Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Fri, 10 Feb 2017 11:49:05 +0100 Subject: [PATCH] [FIX] web: hide list readonly checkbox when entering edition Forward-port of https://github.com/odoo/enterprise/commit/8a55b3f9f7a7524583effb8198c03ebf695131bd There are multiple problems with the editable view list. It should be solved once and for all in the work-in-progress master. This commit fixes a bug with readonly checkboxes. When a field is readonly, the table cell gets the "o_readonly" class which changes its style and behavior. When entering edition, the cells are hidden except the ones with this "o_readonly" class so that their style are not affected. The "o_readonly" cell content however was hidden thanks to a "color: transparent;" rule to let the form readonly field show the value. The problem is that checkboxes... are not hidden with this "color: transparent;" rule. Also, the "o_readonly" class is not toggled during edition while the readonly status could be... so the right fix would be to get rid of this "o_readonly" class and let the inline form handle the behavior, but this would affect style and possibly break unknown behavior. This fix adds rules to handle the checkbox case correctly. --- addons/web/static/src/less/list_view.less | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/less/list_view.less b/addons/web/static/src/less/list_view.less index fd8a51d96be..cb447ea0446 100644 --- a/addons/web/static/src/less/list_view.less +++ b/addons/web/static/src/less/list_view.less @@ -135,6 +135,10 @@ &.o_readonly { visibility: visible; color: transparent; + + > .o_checkbox { + visibility: hidden; + } } } } @@ -155,7 +159,7 @@ max-width: 100%; // Fix a chrome bug where badge would not break on multiple lines } - &.o_readonly { + &.o_readonly:not(.o_checkbox) { background-color: transparent; padding: 5px; }