From 0cb185a126a3f136c9a8aae0415892c8788d4770 Mon Sep 17 00:00:00 2001 From: Romeo Fragomeli Date: Tue, 15 Nov 2022 10:38:04 +0000 Subject: [PATCH] [FIX] web: no red underline on invalid field with no label Since the "always edit" task in form view, the underline (border-bottom) only appears when input is `:focus` or `:hover`. The problem occurs because the rule for `.o_field_invalid` doesn't match, so the transparent color is applied and the red underline only appears when we are hover or when the field has the focus. This commit fixes the problem by setting the border transparent only when the field is not invalid, not hover and not focus and not in a form `.o_field_highlight`. So now, we better see the invalid fields without hovering it. Steps to reproduce: * Open Project * Select a project * Select a task * Create a new task * Try to save manually the task => BUG a notification appears but the "task title" (name field) is not underline Task ID: 3069662 closes odoo/odoo#106123 X-original-commit: 1666ee5515996fab8a843b36b4fd93b776172f75 Signed-off-by: Christophe Monniez (moc) Signed-off-by: Romeo Fragomeli (rfr) --- addons/web/static/src/views/form/form_controller.scss | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/views/form/form_controller.scss b/addons/web/static/src/views/form/form_controller.scss index 8e26de302bf..731537873c7 100644 --- a/addons/web/static/src/views/form/form_controller.scss +++ b/addons/web/static/src/views/form/form_controller.scss @@ -205,16 +205,11 @@ // rules for fields borders: only on hover/focus by default // except when used with o_field_highlight (on parent or on the field) .o_input { - border-color: transparent; padding: $o-input-padding-y $o-input-padding-x; - - &:hover, &:focus { - border-color: var(--o-input-border-color); - } } - &.o_field_invalid .o_input { - border-color: var(--o-input-border-color); + &:not(.o_field_highlight) .o_field_widget:not(.o_field_invalid) .o_input:not(:hover):not(:focus) { + --o-input-border-color: transparent; } .o_datepicker {