From 73bf4d3b4806016823977438cc4453caf973d48c Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Mon, 14 Nov 2022 15:45:08 +0000 Subject: [PATCH] [FIX] web: Field: apply decorations on inputs/textareas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fields in views can be decorated with attributes decoration-xxx (e.g. decoration-danger="state == 'error'"). This typically results in a bootstrap contextual classname being applied on the field's root node (e.g. text-danger). However, these classes have no effect on children inputs and textareas. Since we wrap wowl fields into a div (which thus receives the contextual class), decorations were no longer visible in edition (which is, by the way, the mode of almost all fields in form views now). To fix this issue, we manually force the color of inputs and textareas inside fields, to the color of their parent. closes odoo/odoo#105781 X-original-commit: 4b2624ab3e398fe036832d9348bc319992b4fcd1 Signed-off-by: Michaƫl Mattiello Signed-off-by: Aaron Bohy (aab) Co-authored-by: Romeo Fragomeli --- addons/web/static/src/views/fields/fields.scss | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/web/static/src/views/fields/fields.scss b/addons/web/static/src/views/fields/fields.scss index b7dd74edeb4..0e1681242b9 100644 --- a/addons/web/static/src/views/fields/fields.scss +++ b/addons/web/static/src/views/fields/fields.scss @@ -9,3 +9,12 @@ .o_field_highlight .o_field_widget .o_input, .o_field_highlight.o_field_widget .o_input { border-color: var(--o-input-border-color); } + +// field decoration classes (e.g. text-danger) are set on the field root node, +// but bootstrap contextual classes do not work on input/textarea, so we have to +// explicitely set their color to the one of their parent +.o_field_widget { + input, textarea { + color: inherit; + } +}