[FIX] web: Field: apply decorations on inputs/textareas

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 <mcm@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Romeo Fragomeli <rfr@odoo.com>
This commit is contained in:
Aaron Bohy
2022-11-15 19:21:57 +01:00
co-authored by Romeo Fragomeli
parent 2d7a32a223
commit 73bf4d3b48
@@ -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;
}
}