char_emojis
The char_emojis widget is a standard single-line text input with one addition: an emoji button that opens Odoo's full emoji picker and inserts the chosen emoji at the cursor.
| Technical name | char_emojis |
|---|---|
| Field types | char, text |
| Views | form, list |
| Module | mail, installed with Discuss and any messaging app |
| Used in core | 2 occurrences in 1 module: the mass_mailing Subject and Preview Text fields |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | No. The widget must be set in XML; Studio's widget list does not offer it. |
| Alternatives | text_emojis, char, html_composer_message |
What the Emoji text 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. Names a char field on the current record whose value is shown as the placeholder when the field is empty. Declared in the options metadata since Odoo 19.(since Odoo 19.0) |
dynamic_placeholder | boolean | Inherited and undocumented: read in the char field's extractProps but declared nowhere. Enables the placeholder expression picker used by mail templates. Both core usages of char_emojis set it. |
dynamic_placeholder_model_reference_field | field name | Inherited and undocumented. Names the field holding the model that placeholder expressions are resolved against, for example mailing_model_real on a mailing. |
Only placeholder_field is declared in the options metadata. The dynamic_placeholder pair is read in the char field's extractProps without being declared anywhere, which keeps it out of Studio's properties panel. Both core usages of char_emojis rely on that undocumented pair to offer placeholder expressions based on the selected mailing model.
Working examples
The no-trim override and how insertion works
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Only an internal rewrite is visible on the development branch; see below. |
| Odoo 19.0 | Verified | Verified against the shipped source, including the shouldTrim override. |
| Odoo 18.0 | Verified | Byte-identical to the 19.0 source. |
| Odoo 17.0 | Verified | Same behavior; the release that rewrote the widget onto the shared emoji picker. |
| Odoo 16.0 | Partial / changed | Widget exists under the same name but is a patch-based implementation with the legacy EmojisDropdown component. |
Upgrade note. Odoo 16 implemented this widget by patching CharField with two mixins and registering the component class directly, with a legacy EmojisDropdown component instead of the shared picker. Odoo 17 rewrote it onto useEmojiPicker and a descriptor registration. Any 16-era JavaScript patch against EmojisDropdown will not survive a migration to 17 or later; the 17, 18, and 19 files are functionally identical.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| No emoji button appears on the field | The widget only renders its button in edit mode, and it requires the mail module to be installed. Confirm the record is editable and that widget="char_emojis" is on the field; the widget ships with mail, not web. |
| Emoji lands at the end instead of where the cursor was | The field lost focus before the picker opened, so the browser reports selection at position zero or end. Click into the input first, then open the picker; insertion honors selectionStart and selectionEnd. |
| Emojis show as boxes for some recipients | Not a widget issue. The stored value is plain Unicode; the recipient's device lacks a glyph for that emoji. Prefer widely supported emojis in subject lines and test on the clients your audience uses. |
| Studio does not offer char_emojis in the widget list | The widget declares no Studio display name and is not part of the documented widget set. Set the widget in the view XML directly, or have a developer add it to the form view. |
| Trailing space before an emoji disappears after saving on Odoo 18 or earlier | The explicit shouldTrim getter shipped in 19; earlier versions relied on the extractProps flag, which some custom subclasses dropped. On custom subclasses, make sure shouldTrim stays false, or upgrade to 19 where the getter enforces it. |
Emoji text field vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
char_emojis | Short customer-facing strings where emojis matter, like subjects | Standard char input plus a picker button, nothing else changes |
text_emojis | Multiline notes and SMS bodies | Same picker attached to a textarea instead of an input |
char | Plain single-line text | No picker, and it trims trailing whitespace on save |
| html_composer_message | Full email bodies | Complete rich-text composer with its own emoji command |
Frequently asked questions
What does the char_emojis widget do in Odoo?+
Which fields can use char_emojis?+
Where does Odoo use char_emojis out of the box?+
Can I add char_emojis from Odoo Studio?+
Does char_emojis change how the value is stored?+
Is char_emojis available in Odoo 16, 17, and 18?+
Will char_emojis change in Odoo 20?+
Emojis are the easy part of email marketing
Subject lines, dynamic placeholders, deliverability, and mailing templates all meet in the same form. If your team is building campaign workflows on Odoo or extending mass mailing with custom models, we do that daily for companies on Odoo 16 through 19.
Book a free consultation