Skip to main content
iVentureTeam

char

The default renderer for every text field in Odoo, and the base a dozen other widgets extend. It declares one option and quietly accepts three more.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 27, 2026Updated August 27, 20265 min read
Odoo 19 form showing a single line text input rendered by the char widget.
Studio nameText
Technical namechar
Field typeschar, text
Viewsform, list, kanban
Moduleweb, present in every Odoo database
Used in coreThe default renderer for character fields throughout Odoo
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0
No-code setupYes. Studio's Text field type uses this widget by default
Alternativestext, url, char_emojis, CopyClipboardChar

What the char field does

Most fields in Odoo are text, and most of them are rendered by this widget without anyone naming it. It draws a single line input, writes the value on change, and handles the trimming and the length limit the field declares.

Its second job is less visible and more important: it is the base that specialized text widgets extend. The emoji field, the copy-to-clipboard variants, the survey title cell, the HSN lookup and several others all spread this descriptor, which means whatever this widget extracts is what they inherit.

That inheritance is where the surprises live. Several of those widgets replace the extractor entirely and silently lose everything listed on this page, which is why knowing the base's real option set is worth more than it first appears.

What this means for your team

There is no configuration decision to make about the default widget itself. What is worth knowing is the option set, because two of the entries below solve problems teams routinely solve with customization instead.

The dynamic placeholder is the clearest example. Showing a related value as the hint, rather than static text, tells the user what the field will default to if they leave it empty. That is a common request answered with an onchange, and it is an option.

The password attribute is the other. Masking a text field needs no custom widget, and people frequently build one because the attribute is easy to miss.

Setting it up in Odoo Studio (no code)

Studio's Text field type creates a character field rendered by this widget. To reproduce the core setup:

  1. Open the form in Studio and drag a Text field onto it.
  2. Set its label, which becomes the field's string.
  3. Under the field's properties, set a placeholder if the field needs a static hint.
  4. Save. The field renders with this widget without naming it.

What Studio cannot do here

Studio exposes the label, the placeholder and the standard visibility and required settings. It does not expose the dynamic placeholder option or the password attribute, both of which need view XML or a developer-mode edit of the field's options.

Supported options in Odoo 19

One option is declared. Three more keys are read in the extractor without being declared, so no developer tooling will suggest them. Read from char_field.js, Odoo 19.0.

OptionTypeWhat it does
placeholder_fieldfieldDeclared. Shows the value of the named field as the hint while this one is empty, falling back to the static placeholder attribute.
dynamic_placeholderboolean<strong>Read in the extractor but never declared.</strong> Enables the dynamic placeholder machinery, used mainly in mailing and template editors.(default: false)
dynamic_placeholder_model_reference_fieldfield<strong>Read in the extractor but never declared.</strong> Names the field carrying the model reference the dynamic placeholder resolves against.
passwordboolean (attribute)An attribute on the field element, not an option. Renders a masked input, which removes the need for a custom masking widget.(default: false)
autocompletestring (attribute)An attribute on the field element. Passed to the browser's autocomplete handling.
placeholderstring (attribute)The static hint, used when no dynamic placeholder resolves.

Two of the four are attributes, not options. The password and autocomplete settings are read from the field element's attributes rather than from the options dictionary, which is why they are easy to miss when reading a view.

Working examples

Implicit usage

<field name="reference"/>

No widget attribute needed. A character field falls through to this widget by type.

A dynamic placeholder

<field name="invoice_ref"
       options="{'placeholder_field': 'partner_ref'}"/>

The other field's value is shown as the hint while this one is empty, falling back to the static placeholder attribute.

A masked input

<field name="api_key" password="True"/>

An attribute rather than an option, and the reason a custom masking widget is rarely needed.

What every descendant inherits

The extractor is the whole story of this widget, because it defines what every descendant inherits. It reads four things: the password attribute, which switches the input to a masked one; the autocomplete attribute, which is passed to the browser; the placeholder, which is the static hint; and two options driving the dynamic placeholder machinery.

Only the dynamic placeholder field is declared in the supported options. The other dynamic placeholder key and its model reference companion are read and never announced, which puts them in the same category as several other undeclared keys across Odoo: functional, but invisible to tooling.

The component itself adds one behavior worth naming: it trims the value. Descendants that need to preserve trailing spaces, such as the emoji variant, override that explicitly, which is a good way to spot a widget that cares about exact text.

The supported types include both single line and multi-line fields. Placing this widget on a multi-line field is legitimate and gives a single line input, which is occasionally exactly what a long field needs on a dense list.

Version compatibility

VersionStatusNotes
Odoo 20.0Partial / changedNot released. Same option set; internals migrated to the new props syntax.
Odoo 19.0VerifiedVerified against the shipped source.
Odoo 18.0VerifiedSame option set.
Odoo 17.0VerifiedSame option set.
Odoo 16.0VerifiedSame option set with older component conventions.

Upgrade note. The option set has been stable across Odoo 16 to 19, so views carry over. What has changed is internal structure, which matters only to code that patches the widget. If a custom widget spreads this descriptor and replaces the extractor, check that it still forwards the attributes you rely on.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The development branch is unstable and this may still change; we re-verify this page after the release.

The option set is unchanged. The declared dynamic placeholder option, the undeclared pair and the two attributes all behave the same on the development branch. The differences are the migration to the new props syntax, which affects patches rather than views.

Common problems and fixes

SymptomCause and fix
The dynamic placeholder does not showThe named field is empty, or the field being edited already has a value. Check the source field; the hint only shows while this field is empty.
Trailing spaces are removedThe widget trims the value. Use a variant that overrides trimming, such as the emoji field, if exact text matters.
The password attribute is ignoredA specialized widget replaced the extractor and no longer reads it. Check which widget the field uses; several descendants drop the inherited attributes.
Developer tooling does not offer the dynamic placeholder keysTwo of them are read but never declared. Consult this page or the source.
A multi-line value renders on one lineThis widget supports both types and always renders a single line input. Use the text widget if several lines should be visible.
The value exceeds the expected lengthLength limits come from the field definition, not the widget. Set the size on the model field.

Char field vs the alternatives

WidgetBest forKey difference
charAny single line text value, and as the base other text widgets extendDeclares one option and quietly reads three more keys plus two attributes
textValues needing several visible linesA textarea rather than a single line input
urlLinksRenders a clickable link when read-only
char_emojisShort copy that benefits from emojiAdds a picker and preserves trailing spaces
CopyClipboardCharValues users copyAdds a copy affordance beside the text

Use the multi-line text widget where the value genuinely needs several lines, the link widget where it is a URL, and the email or phone widgets where the value should be actionable. Reach for a specialized variant such as the emoji or copy-to-clipboard widgets only when the extra affordance is wanted, because several of them lose the inherited options listed here.

Frequently asked questions

Do I need to write widget="char"?+
No. A character field falls through to this widget by type. Naming it explicitly is only useful on a field of another supported type, such as a multi-line field you want on one line.
How do I show another field's value as the hint?+
With the placeholder_field option, which is the one option this widget declares. It falls back to the static placeholder attribute when the named field is empty.
How do I mask a text field?+
With the password attribute on the field element. It is an attribute rather than an option, which is why it is often missed and reimplemented as a custom widget.
Why do some widgets lose these options?+
Because they spread this descriptor but then define their own extractor. Anything that does not call through loses the placeholder, the password attribute and the autocomplete handling.
Does it trim what I type?+
Yes. Descendants that need exact text, such as the emoji variant, override that explicitly.

The options nobody knew were already there

A surprising share of Odoo customization reimplements behavior the standard widgets already offer. We review customizations against what the version you run actually supports, on Odoo 16 through 19.

Book a free consultation

How this page was produced

The declared option, the three undeclared keys read in the extractor, the trimming behavior and the supported types were read from char_field.js on the Odoo 19.0 branch. Version coverage comes from comparing the same file across the 16.0, 17.0 and 18.0 branches and against the public development branch. Studio's Text field type was checked against the Odoo 19 Studio fields documentation. Spotted an error? Tell us and we will correct the page.