From 9fcde051685d49dc6e1cc7fc6c9b90c8efe5974b Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 13 Nov 2012 14:18:06 +0100 Subject: [PATCH] [FIX] clicking on checkbox (boolean field) of list view should correctly trigger whatever the row action is replaced @disabled checkboxes for boolean fields by @readonly + alpha (50%), as disabled input do not generate *any* event. Not default action (of course) but not e.g. a click either, whether delegated or bound directly on the element, there's no way at all to see if e.g. a user has clicked on a disabled checkbox or radio. lp bug: https://launchpad.net/bugs/1013569 fixed bzr revid: xmo@openerp.com-20121113131806-7fhog1f96gxnjr67 --- addons/web/static/src/css/base.css | 4 ++++ addons/web/static/src/css/base.sass | 2 ++ addons/web/static/src/js/view_list.js | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 2c3150188db..c43e98a174a 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2731,6 +2731,10 @@ .openerp .oe_list_content > tbody > tr > td.oe_list_checkbox:first-child:after, .openerp .oe_list_content > tbody > tr th.oe_list_checkbox:first-child:after { border-width: 0; } +.openerp .oe_list_content > tbody > tr > td.oe_list_field_boolean input { + filter: alpha(opacity=50); + opacity: 0.5; +} .openerp .oe_list_content > tbody > tr:nth-child(odd) { background-color: #f0f0fa; background-color: #f0f0fa; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 07f5c3eb666..e201bf94b9b 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2165,6 +2165,8 @@ $sheet-padding: 16px width: 17px &:after border-width: 0 + > td.oe_list_field_boolean input + @include opacity() > tr:nth-child(odd) background-color: #f0f0fa @include vertical-gradient(#f0f0fa, #eeeef6) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 321faf40c0f..700c126d68d 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -2156,7 +2156,7 @@ instance.web.list.Boolean = instance.web.list.Column.extend({ * @private */ _format: function (row_data, options) { - return _.str.sprintf('', + return _.str.sprintf('', row_data[this.id].value ? 'checked="checked"' : ''); } });