char_with_placeholder_field
A char field that never looks empty: char_with_placeholder_field shows the placeholder as a muted value, so users see the default Odoo will apply before it is applied.
| Technical name | char_with_placeholder_field |
|---|---|
| Field types | char, text |
| Views | form, list (accounting wizards and expense views) |
| Module | account, installed with Invoicing or Accounting |
| Used in core | 7 occurrences across account (payment register wizard), l10n_account_withholding_tax, hr_expense |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0 |
| No-code setup | No. Set in view XML; the closest Studio concept is the general Placeholder property, which does not render into the value |
| Alternatives | char, text, CopyClipboardChar |
What the Char with Placeholder field does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
placeholder_field | field name | Inherited from the char widget: a char or text field on the record whose value serves as the dynamic placeholder, which this widget then also renders as the empty-value fallback. |
dynamic_placeholder | boolean | Inherited extractProps-only knob of the char widget enabling the dynamic placeholder popup used by mail templates. Not declared in any options panel. |
dynamic_placeholder_model_reference_field | field name | Companion extractProps-only knob naming the field that holds the model for dynamic placeholder resolution. |
The placeholder itself is not an option. It comes from the standard placeholder attribute on the field element, or dynamically via the inherited placeholder_field option. If neither is set, the widget behaves exactly like a plain char field: empty renders empty.
Working examples
Value, placeholder, and what actually saves
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. File byte-identical on the development branch. See below. |
| Odoo 19.0 | Verified | Verified against the shipped source; fallback reads props.placeholder directly. |
| Odoo 18.0 | Verified | First version with this widget; same behavior via the component's placeholder getter. |
| Odoo 17.0 | Not available | Widget does not exist; the file is absent from the 17.0 tree. |
| Odoo 16.0 | Not available | Widget does not exist; the file is absent from the 16.0 tree. |
Upgrade note. The widget appeared in 18.0. Views coming from 17.0 or earlier that want this behavior must switch the widget name explicitly; there is nothing to migrate automatically. From 18 to 19 the only change is internal (the fallback reads the prop instead of the component getter).
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The field looks filled but exports show it empty | The muted text is the placeholder fallback, not stored data. Working as designed; the muted styling is the cue. Type a value to store one. |
| Empty cells still render blank | No placeholder attribute and no placeholder_field option are set, so there is nothing to fall back to. Add placeholder="..." on the field element or a placeholder_field option. |
| The fallback text is not muted | Custom CSS overrides text-muted, or the record actually has a stored value equal to the hint. Inspect the cell: the widget only adds text-muted when the stored value is empty. |
| widget="char_with_placeholder_field" errors on Odoo 17 | The widget shipped in 18.0. Use a plain char field on 17, or backport the component in a custom module. |
| Dynamic placeholder does not update | The field named in placeholder_field is not loaded in the view or is not recomputed. Ensure the source field is in the view (invisible is fine) and its compute triggers on the right dependencies. |
Char with Placeholder field vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
char_with_placeholder_field | Char fields whose empty state should show the computed default | Renders the placeholder as a muted value instead of a blank cell |
char | Ordinary text without fallback display | Placeholder shows only in the editable input, never as rendered text |
| text | Multiline notes | Multiline editing, standard placeholder behavior |
| CopyClipboardChar | Values users copy out of Odoo | Adds a copy button rather than a fallback display |
Frequently asked questions
What does char_with_placeholder_field do in Odoo?+
Is the placeholder saved to the database?+
Can the placeholder come from a computed field?+
Which Odoo versions have char_with_placeholder_field?+
Does it work on multiline text fields?+
How is this different from a normal placeholder?+
Forms that make users guess the default?
Small display decisions like a visible computed reference save real support load. We refine Odoo accounting screens, from wizard UX to localization quirks, so your finance team stops second-guessing what Odoo will fill in.
Book a free consultation