Repository navigation
Conversation
The field_color/colors options had no effect on many2one fields in 19.0: - Many2OneField.m2oProps and the computeM2OProps override forwarded searchLimit but not fieldColor/fieldColorOptions, so the options never reached Many2XAutocomplete; Many2One did not declare them either. - loadOptionsSource matched suggestions on option.value, which 19.0 suggestions no longer have: the record is in option.data.record. Adds a hoot test covering the dropdown colouring. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds a color_style option next to field_color/colors. "text" (the default) keeps the current text colouring unchanged. "bar" draws a thin accent bar on the left of each suggestion and leaves the text alone, so contrast does not suffer in either theme. With "bar", Bootstrap theme colour names (success, info, warning, ...) resolve through Odoo's theme CSS variables and so follow the light or dark theme; any other value is used as a CSS colour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #3696. It contains that PR's commit; only the last commit is new here.
field_colorcolours the suggestion text. In practice that gives poor contrast, and a fixed CSS colour cannot suit both the light and the dark theme.This adds a
color_styleoption:text(the default, or no option at all): exactly the current behaviour,color:<value>.bar: a thin accent bar on the left of each suggestion (an insetbox-shadow, so there is no layout shift). The text is left alone.With
bar, Bootstrap theme colour names (primary,secondary,success,info,warning,danger,light,dark) resolve through Odoo's theme CSS variables. Odoo compiles Bootstrap without thebs-prefix, so these are--successetc., and they are defined with different values inweb.assets_webandweb.assets_web_dark, so the bar follows the theme. Any other value is used as a CSS colour.Supported on many2one and many2many tags, like
field_color. Documented inreadme/USAGE.md.Tests: one checks that
color_style: 'text'keeps the current output. The other checks thebarstyle for a theme name and a raw colour, and asserts the computedbox-shadowactually resolves, so an undefined variable cannot pass silently.🤖 Generated with Claude Code