From b5c595e0aaa7efb57550ced7f94cc456032fa3de Mon Sep 17 00:00:00 2001 From: "Levi Siuzdak (sile)" Date: Fri, 11 Aug 2023 16:45:29 +0200 Subject: [PATCH] [FIX] web: fix list view when grouping rows that start with numbers Versions: --------- - saas-16.3 - saas-16.4 Steps to reproduce: ------------------- 1. go to a list view which starts with a numerical value; - e.g. with developer mode enabled: Settings > Technical > Scheduled Actions 2. group by any element. Issue: ------ The width of the `o_group_name` elements is around 40px, not enough for the names to be displayed. Cause: ------ `list_renderer.js` calculates the `colspan` of `o_group_name` elements based on the first occurence of a value that can be aggregated, i.e. any numerical value. If this happens to be the first column, the `colspan` is set to 1, leading to their width being the same as the first column containing checkboxes. An update in saas-16.3 had forcibly set these to 40px by adding the `!important` rule: ```scss .o_list_record_selector { width: 40px !important; // Force to 40px regardless by the font-size } ``` Solution: --------- After consulting the person who introduced the rule, we agreed that removing it would be the easiest fix, unlikely to introduce any new issues. opw-3459598 closes odoo/odoo#133521 X-original-commit: c89c94192685c989b65eb6b483b4120aa312252c Signed-off-by: Levi Siuzdak (sile) Signed-off-by: Romeo Fragomeli (rfr) Signed-off-by: Levi Siuzdak --- addons/web/static/src/views/list/list_renderer.scss | 2 +- addons/web/static/tests/views/list_view_tests.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/views/list/list_renderer.scss b/addons/web/static/src/views/list/list_renderer.scss index db3ab414849..fa249c98718 100644 --- a/addons/web/static/src/views/list/list_renderer.scss +++ b/addons/web/static/src/views/list/list_renderer.scss @@ -145,7 +145,7 @@ } .o_list_record_selector { - width: 40px !important; // Force to 40px regardless by the font-size + width: 40px; // Don't force to keep o_group_name width dynamic } .o_list_record_remove, .o_handle_cell, .o_list_record_open_form_view { diff --git a/addons/web/static/tests/views/list_view_tests.js b/addons/web/static/tests/views/list_view_tests.js index c2c8d8f9231..8c59b1dc479 100644 --- a/addons/web/static/tests/views/list_view_tests.js +++ b/addons/web/static/tests/views/list_view_tests.js @@ -4599,7 +4599,7 @@ QUnit.module("Views", (hooks) => { assert.strictEqual( target.querySelector("thead .o_list_record_selector").offsetWidth, - 40 + 41 ); const widthPage1 = target.querySelector(`th[data-name=foo]`).offsetWidth; @@ -4607,7 +4607,7 @@ QUnit.module("Views", (hooks) => { assert.strictEqual( target.querySelector("thead .o_list_record_selector").offsetWidth, - 40 + 41 ); const widthPage2 = target.querySelector(`th[data-name=foo]`).offsetWidth; assert.ok(