Skip to main content
iVentureTeam

shortcut

Odoo 19's shortcut widget dresses a plain char field with a fixed :: prefix, so the canned response form reads exactly like what users will type in the Discuss composer.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 24, 2026Updated August 24, 20266 min read
Technical nameshortcut
Field typeschar
Viewslist, form, kanban
Modulemail, shipped with every Odoo database
Used in core3 occurrences in the mail module, all on mail.canned.response
VersionsOdoo 20.0, Odoo 19.0
No-code setupNo. XML only, and only worth it for shortcut-like fields
Alternativeschar, char_with_placeholder_field, text

What the shortcut widget does

Canned responses in Odoo Discuss are triggered by typing :: followed by a shortcut, and picking the suggestion that pops up. The configuration form for those responses stores only the shortcut text, which left a small gap: the admin types hello into a field, while users trigger it as ::hello. Odoo 19 closed that gap with the shortcut widget, which renders the field with a non-editable :: printed immediately before the input.

Reading the source, it is one of the smallest field widgets in the codebase: a component that wraps the standard CharField, a template that puts a :: span next to it, and a getter that forces the placeholder to e.g. hello. There is no descriptor, no options, no extractProps. The stored value is the bare shortcut; the colons are pure presentation.

Core applies it to the source field of mail.canned.response in all three of that model's views, so whether you manage canned responses as a list, a form or kanban cards, the shortcut always appears in its trigger syntax.

What this means for your team

Canned responses are one of the quietest productivity wins in Odoo: support and sales teams that live in Discuss or the chatter answer routine questions in two keystrokes instead of twenty words. The widget's contribution is small but real, it teaches the syntax passively. Anyone who edits a canned response sees ::hello and knows exactly what to type in a conversation, without reading documentation.

If you are rolling canned responses out to a team, this page's practical advice is about the data, not the widget: keep shortcuts short, lowercase and collision-free, and agree on a naming scheme per team, such as ::inv- prefixes for invoicing answers. The widget will faithfully display whatever chaos you create.

For developers, the widget doubles as a pattern: when a stored value is always used with a fixed prefix, showing that prefix in the form removes a whole class of user confusion. The source is fifteen lines, easy to copy for a # reference field or a keyboard-trigger field in a custom app.

Working examples

The core pattern, from the canned responses views

<field name="source" widget="shortcut" readonly="not is_editable"/>

Reusing it on a custom trigger field

<field name="trigger_code" widget="shortcut"/>

Any char field accepts it, but the :: prefix and the e.g. hello placeholder come along unconditionally, so it only makes sense where the double-colon syntax is true.

What a bare component registration means

The registration style is the technical detail worth noticing. Most field widgets register a descriptor object with supportedTypes, supportedOptions and extractProps; this one registers { component: ShortcutCharField } and nothing else. Consequences, all verified in source:

No type guard. Without supportedTypes, the widget never warns about field types. It will happily mount on any field whose value a CharField can render, and produce odd results on non-char types.

No option plumbing. With no extractProps, nothing from options="{}" reaches the component. Attributes that the standard char widget would honor through its own extractProps, like password or autocomplete hints, are also out, because this registration bypasses the char descriptor entirely and only reuses its component and props shape.

The prefix is not part of the value. The template renders :: in a separate span, so searching, exporting and the Discuss matcher all see the raw shortcut text. Users who type the colons into the field itself create a response triggered by ::::hello, which is the one real data-entry mistake this widget cannot prevent.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. Byte-level framework migration only on the development branch; behavior unchanged. See below.
Odoo 19.0VerifiedIntroduced in 19.0 with the mail.canned.response model; verified against the shipped source.
Odoo 18.0Not availableDoes not exist; canned responses (mail.shortcode) used a plain char field.
Odoo 17.0Not availableDoes not exist.
Odoo 16.0Not availableDoes not exist.

Upgrade note. The widget is new in Odoo 19, arriving together with the mail.canned.response model rename (from mail.shortcode in earlier versions). Views migrated from 18 that still target the old model need more than the widget to work.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026, and as always we read the public development branch rather than guessing, with the caveat that it is unstable until release.

Nothing user-facing changes on master. The file's only diff is the framework-wide props migration (useProps and shared charFieldProps instead of static props), part of the same wave touching most field widgets this cycle. Registration name, template, the :: span and the hardcoded placeholder are all intact.

The pattern to watch is around it, not in it: canned responses themselves gained scope and role features across recent versions, so if you customize that screen, re-test the whole view after the upgrade rather than this widget alone. We re-verify this page against the shipped release.

Common problems and fixes

SymptomCause and fix
Custom placeholder attribute does not showThe component hardcodes the placeholder to e.g. hello after spreading props. Accept the default, or subclass the widget to change it.
Canned response triggers with four colonsThe user typed :: into the field although the widget already displays the prefix. Store the shortcut without colons; the field value must be the bare text.
Options in XML have no effectBare component registration; there is no extractProps to read them. None needed, the widget is configuration-free by design.
Widget renders on a non-char field with odd resultsNo supportedTypes declared, so nothing blocks the assignment. Keep it on char fields; use proper widgets elsewhere.
Shortcut field is grayed out for some usersCore binds readonly to is_editable, which reflects access to shared responses. Expected: users edit their own responses, managers edit shared ones.

Shortcut widget vs the alternatives

WidgetBest forKey difference
shortcutChar fields always used with the :: trigger syntaxFixed :: prefix and forced placeholder, zero configuration
charOrdinary single-line textFull option and attribute support, no prefix
char_with_placeholder_fieldChar fields with a record-driven placeholderDynamic placeholder from another field, no prefix
textMulti-line content like the response bodyTextarea rendering, used right next to this widget on the same form

The alternatives are only relevant when the double-colon story is not: for ordinary short text the plain char family does everything this widget does, minus the prefix.

Frequently asked questions

What does the shortcut widget do in Odoo?+
It renders a char field with a fixed :: prefix and an e.g. hello placeholder, mirroring the syntax that triggers canned responses in Discuss and the chatter. Odoo 19 uses it on the source field of mail.canned.response.
Are the colons stored in the field?+
No. The prefix is a separate span in the template; the database stores only the shortcut text. Typing colons into the field creates a broken double-prefix trigger, which is the main user mistake to watch for.
Does the shortcut widget have any options?+
None. It is registered as a bare component without a descriptor, so there are no supported options and no extractProps; even the placeholder attribute is overridden by the hardcoded one.
Can I use the shortcut widget on my own fields?+
Yes, any char field accepts it, but the :: prefix and the canned-response placeholder come with it unconditionally. It only makes sense for fields that really use the double-colon trigger convention; otherwise copy its fifteen-line pattern and change the prefix.
How do canned responses relate to this widget?+
Canned responses are text snippets inserted by typing ::shortcut in the Discuss composer or chatter. This widget is only their configuration UI nicety; the matching and insertion logic lives in the composer, not here.
Does the widget change in Odoo 20?+
The development branch shows only the framework-wide props migration, with identical behavior and registration. That is provisional until the September 2026 release, and we re-verify the page then.

Roll out canned responses your team actually uses

We set up canned response libraries with naming schemes that scale past fifty entries, scope them per team, and build the same double-colon ergonomics into custom apps. Small Discuss tweaks like this are where support teams win back an hour a day.

Boost my team's Discuss workflow

How this page was produced

Verified by reading shortcut_char_field.js and its QWeb template on the Odoo 19.0 branch, confirming the bare component registration, the hardcoded placeholder and the display-only prefix, and diffing the same file against the public development branch for the Odoo 20 section. Core usage was read from the mail.canned.response list, form and kanban archs, including the ignored placeholder attribute in the list view. Corrections welcome via our contact page.