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.
| Studio name | Text |
|---|---|
| Technical name | char |
| Field types | char, text |
| Views | form, list, kanban |
| Module | web, present in every Odoo database |
| Used in core | The default renderer for character fields throughout Odoo |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | Yes. Studio's Text field type uses this widget by default |
| Alternatives | text, url, char_emojis, CopyClipboardChar |
What the char field does
What this means for your team
Setting it up in Odoo Studio (no code)
What Studio cannot do here
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
placeholder_field | field | Declared. Shows the value of the named field as the hint while this one is empty, falling back to the static placeholder attribute. |
dynamic_placeholder | boolean | <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_field | field | <strong>Read in the extractor but never declared.</strong> Names the field carrying the model reference the dynamic placeholder resolves against. |
password | boolean (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) |
autocomplete | string (attribute) | An attribute on the field element. Passed to the browser's autocomplete handling. |
placeholder | string (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
What every descendant inherits
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | Partial / changed | Not released. Same option set; internals migrated to the new props syntax. |
| Odoo 19.0 | Verified | Verified against the shipped source. |
| Odoo 18.0 | Verified | Same option set. |
| Odoo 17.0 | Verified | Same option set. |
| Odoo 16.0 | Verified | Same 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
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The dynamic placeholder does not show | The 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 removed | The widget trims the value. Use a variant that overrides trimming, such as the emoji field, if exact text matters. |
| The password attribute is ignored | A 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 keys | Two of them are read but never declared. Consult this page or the source. |
| A multi-line value renders on one line | This 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 length | Length limits come from the field definition, not the widget. Set the size on the model field. |
Char field vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
char | Any single line text value, and as the base other text widgets extend | Declares one option and quietly reads three more keys plus two attributes |
| text | Values needing several visible lines | A textarea rather than a single line input |
| url | Links | Renders a clickable link when read-only |
| char_emojis | Short copy that benefits from emoji | Adds a picker and preserves trailing spaces |
| CopyClipboardChar | Values users copy | Adds a copy affordance beside the text |
Frequently asked questions
Do I need to write widget="char"?+
How do I show another field's value as the hint?+
How do I mask a text field?+
Why do some widgets lose these options?+
Does it trim what I type?+
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