From f88577ec701b581bc65a1180056b16822dea00b6 Mon Sep 17 00:00:00 2001
From: Julien Mougenot <jum@odoo.com>
Date: Thu, 11 Jul 2019 09:33:53 +0000
Subject: [PATCH] [FIX] web: correctly display styles in list view

Before this commit, there was a slight offset preceding list selectors,
and the red border of invalid fields was not shown in community.

Now list selectors are correctly displayed as well as invalid fields.
---
 addons/web/static/src/scss/fields.scss        |  1 -
 addons/web/static/src/scss/list_view.scss     | 12 ++++-----
 .../web/static/src/scss/list_view_extra.scss  | 26 +++++++++++++++----
 3 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/addons/web/static/src/scss/fields.scss b/addons/web/static/src/scss/fields.scss
index cf33561bc50b..b9f85f2d5c06 100644
--- a/addons/web/static/src/scss/fields.scss
+++ b/addons/web/static/src/scss/fields.scss
@@ -52,7 +52,6 @@
         width: 100%;
 
         > input {
-            height: 100%;
             padding-right: 15px;
             cursor: pointer;
         }
diff --git a/addons/web/static/src/scss/list_view.scss b/addons/web/static/src/scss/list_view.scss
index a2ab20f309f1..6932628b9e90 100644
--- a/addons/web/static/src/scss/list_view.scss
+++ b/addons/web/static/src/scss/list_view.scss
@@ -1,4 +1,3 @@
-
 .o_list_view {
     position: relative;
 
@@ -88,7 +87,11 @@
             }
         }
 
-        .o_list_record_selector, .o_list_record_remove, .o_handle_cell {
+        .o_list_record_selector {
+            width: 40px;
+            padding-left: $o-horizontal-padding;
+        }
+        .o_list_record_remove, .o_handle_cell {
             width: 1px;  // to prevent the column to expand
         }
 
@@ -176,9 +179,6 @@
         &.o_editable_list {
             table-layout: fixed;
 
-            .o_list_record_selector {
-                width: 40px;
-            }
             .o_list_record_remove_header, .o_handle_cell {
                 width: 32px;
             }
@@ -198,7 +198,6 @@
             .o_data_row.o_selected_row > .o_data_cell:not(.o_readonly_modifier) {
                 position: relative; // for o_field_translate
                 background-color: white;
-
                 .o_input {
                     border: none;
                     padding: 0;
@@ -229,6 +228,7 @@
                         padding-right: 15px; // to prevent caret overlapping
                     }
                     > .o_dropdown_button, .o_datepicker_button {
+                        margin-right: 5px;
                         @include o-position-absolute(0, 0);
                     }
                 }
diff --git a/addons/web/static/src/scss/list_view_extra.scss b/addons/web/static/src/scss/list_view_extra.scss
index f72d6b21dd6d..9a16fb693479 100644
--- a/addons/web/static/src/scss/list_view_extra.scss
+++ b/addons/web/static/src/scss/list_view_extra.scss
@@ -11,10 +11,26 @@
            background-image: linear-gradient(to bottom, #fcfcfc, $o-form-lightsecondary);
         }
     }
-    // Subpixels computation is different accross browsers and platforms as no
-    // rounding rule is specified by HTML5. Difference in this computation
-    // breaks one of the editable list tests on Chrome and Firefox on MacOS.
-    .o_field_many2manytags {
-        min-height: 21px;
+
+    .o_list_table.o_editable_list .o_data_row.o_selected_row > .o_data_cell:not(.o_readonly_modifier) {
+        padding: .15rem;
+        .o_input {
+            border: none;
+            padding: .15rem;
+            .o_input {
+                box-shadow: none;
+                padding: 0;
+            }
+        }
+        select.o_input {
+            padding: .25rem 0;
+        }
+        .o_field_boolean {
+            padding-top: .15rem;
+            padding-bottom: .15rem;
+        }
+        &.o_invalid_cell .o_input {
+            box-shadow: 0 0 0 1px theme-color('danger');
+        }
     }
 }
-- 
GitLab