Skip to main content
iVentureTeam

color_picker

The color_picker widget edits the integer 0 to 11 behind Odoo's standard palette, the same twelve colors tags, badges and kanban cards read.

August 11, 2026Updated August 11, 20265 min read
Odoo 19 tag form showing the color_picker widget as a row of twelve color swatches with the current one selected.
Studio name(selectable as widget on integer fields)
Technical namecolor_picker
Field typesinteger
Viewsform, list, kanban
Moduleweb, present in every Odoo database
Used in core54 occurrences across 25 modules, tag configuration forms throughout (CRM, project, contacts, helpdesk-style models)
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0
No-code setupPartly: set the widget on an integer field in Studio's Properties
Alternativeskanban_color_picker, many2many_tags, badge, color

What the color_picker widget does

Every colored tag in Odoo stores its color as a small integer, and this widget is the standard editor for that integer. It renders Odoo's twelve-swatch palette, index 0 for "no color" through 11, and writes the picked index into the field.

The source adapts the presentation to the view. In list views, where a tag model's rows are usually edited inline, the full swatch row is always expanded so recoloring is one click. In form and kanban views it starts as just the current swatch and expands when clicked, verified in extractProps, which derives that toggle behavior from the view type. Readonly contexts show the swatch without interaction.

What it deliberately is not: a free color picker. There is no hex input and no custom colors, because the value is an index into a palette, not a color itself.

What this means for your team

The palette being an index is what keeps Odoo's color language consistent. Tag color 3 looks identical in the tags widget, on kanban cards and in badges, across every app, and this widget is where that number gets set. Give your custom tag models the standard pair, a name and an integer color edited with this widget, and every consumer of the palette works with zero extra code.

The twelve-swatch limit is a feature in disguise. Teams that want brand-exact hex colors on tags are usually about to build an unmaintainable styling exception; the palette forces a small, readable color vocabulary that survives upgrades. Spend the effort on assigning meanings to colors, red for blocked, green for approved, and writing those meanings down.

Setting it up in Odoo Studio (no code)

Studio can apply the widget to any integer field.

  1. Open the form or list in Studio and select the integer field (conventionally named color).

  2. In Properties, set Widget to the color picker entry.

What Studio cannot do here

Nothing further to configure: the widget has no options, and the palette itself is not customizable from Studio (or from XML; it is the shared core palette).

Supported options in Odoo 19

Verified against color_picker_field.js in the Odoo 19.0 web module: the descriptor declares no supportedOptions. The row below documents the derived behavior instead.

OptionTypeWhat it does
(none)n/aNo supportedOptions declared. Behavior is fixed: integer 0-11, full row in list views, click-to-expand elsewhere (canToggle derived from view type in extractProps).

The expand-versus-toggle split is automatic. canToggle is computed from the view type (everything except list toggles) and cannot be forced from XML. If you need an always-expanded picker on a form, that is a small widget extension, not an option.

Working examples

The standard tag-model pair

class ProjectTag(models.Model):
    _name = "project.tag"

    name  = fields.Char(required=True)
    color = fields.Integer(string="Color")  # 0 = none, 1..11 = palette

Inline recoloring in the tag list

<list editable="bottom">
    <field name="name"/>
    <field name="color" widget="color_picker"/>
</list>

List views render the full swatch row, so managing a tag taxonomy's colors is one screen.

On the tag's form

<field name="color" widget="color_picker"/>

Shows the current swatch; clicking expands the palette. The pick updates the field and saves with the record like any other edit.

One integer, four widgets

The index this widget writes is consumed by a small family of widgets, and knowing the wiring turns color features from custom work into configuration.

many2many_tags reads it through its color_field option, colors the pills, and in form views offers its own mini palette on click; that popup and this widget write the same integer.

badge reads it through color_field too, as classes o_badge_color_0 to _11.

kanban_color_picker is the card-menu variant that sets the same index from a kanban card's dropdown.

And index 0 has shared meaning: everywhere in the family, 0 renders as the neutral no-color state, which is why hiding a tag's color band and clearing a badge are both "set it to 0".

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. The development branch shows no behavior changes; see below.
Odoo 19.0VerifiedVerified against the shipped source and tested on a clean database.
Odoo 18.0VerifiedSame behavior. No XML changes needed.
Odoo 17.0VerifiedSame behavior. No XML changes needed.
Odoo 16.0VerifiedSame behavior. No XML changes needed.

Upgrade note. Widget and palette are unchanged from Odoo 16 through 19; views carry over untouched. If custom SCSS overrode palette colors, re-test it per version, as the class names are stable but the shipped shades have shifted slightly over time.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The changes below are read from the public development branch and are not final until release.

Nothing changes for this widget. Same twelve indexes, same view-dependent toggle behavior, same absence of options. Internal syntax moves to the new Owl props system, affecting JavaScript patches only. We re-verify once Odoo 20 ships.

Common problems and fixes

SymptomCause and fix
Palette does not expand on clickThe field is readonly in this context; readonly shows the swatch only. Check readonly conditions on the field and view.
Picked color does not appear on the tagsThe consuming widget is not wired to the field: many2many_tags/badge need color_field pointing at it. Add options="{'color_field': 'color'}" on the consumer.
Need brand hex colors instead of the paletteThe value is a palette index by design; there is no hex storage. Restyle the palette classes in SCSS if you must, or accept the 12-color vocabulary.
Color reverted after leaving the form without savingUnlike the tags widget's popup, this widget does not save on pick. Save the record; the pick is a normal pending edit.
Widget errors on a char fieldSupported type is integer only. Store the index in an integer field; use the color widget family for other needs.

Color_picker widget vs the alternatives

WidgetBest forKey difference
color_pickerEditing the palette index on tag-like modelsThe direct editor for the shared 0-11 color integer; no options, view-adaptive display
kanban_color_pickerRecoloring records from a kanban card menuSame palette, presented in the card's dropdown
many2many_tagsColoring tag pills on documentsConsumes the integer via color_field; its form popup edits it too
badgeColored status pillsRead-only consumer of the same index
colorFree hex color valuesEdits an actual color string, not a palette index

The practical test: editing a palette index on the tag model itself, this widget. Recoloring from a kanban card menu, kanban_color_picker. Coloring the display of another field, that is the consumer widgets' color_field option, not a picker at all.

Frequently asked questions

How do I let users pick a tag color in Odoo?+
Give the tag model an integer field (conventionally color) and edit it with widget="color_picker". Tags, badges and kanban then read the same index through their color_field options.
What do the color numbers 0 to 11 mean?+
Indexes into Odoo's shared palette, listed verbatim in the source as RECORD_COLORS. 0 is "no color"; 1 to 11 are the standard swatches used identically across tags, badges and kanban cards.
Why does the picker look different in list and form views?+
Verified in extractProps: list views get the always-expanded swatch row, other views get the current swatch that expands on click. It is derived from the view type and not configurable.
Can I add more colors or use hex values?+
Not with this widget: the stored value is a palette index, which is what keeps colors consistent system-wide. Custom shades mean restyling the palette classes in SCSS, and hex storage means the color widget on a char field instead.
Does picking a color save the record?+
No. The source updates the field without an immediate save, so the pick behaves like any other pending edit, unlike the tags widget's color popup, which saves the tag instantly.
Which widget recolors kanban cards?+
The card menu uses kanban_color_picker, a separate widget writing the same integer. This one is the form/list editor for the field itself.

Building a tag taxonomy your team actually uses?

Consistent colors, locked lists and meanings everyone knows: small configuration with daily payoff. We set up tag models, palettes and the views around them as part of Odoo customization on 16 through 19.

Book a free consultation

How this page was produced

The palette indexes, the view-dependent toggle logic and the optionless descriptor were read from the Odoo 19.0 web module source (color_picker_field.js) and confirmed on a clean Odoo 19 database, where the screenshot was captured. The Odoo 20 statement comes from the same file on the public development branch, where it is unchanged. Spotted an error? Tell us and we will correct the page.