Skip to main content
iVentureTeam

CopyClipboardChar

One of the only CamelCase widget names in Odoo core: CopyClipboardChar puts a one-click copy button next to a text value. Small widget, several sharp edges.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 12, 2026Updated August 12, 20267 min read
Odoo 19 form view showing a text value rendered by the CopyClipboardChar widget with its Copy button beside the field, ready to copy the value to the clipboard.
Studio nameCopy to Clipboard
Technical nameCopyClipboardChar
Field typeschar
Viewsform, list
Also registered asCopyClipboardURL and CopyClipboardButton, defined in the same file
Moduleweb, present in every Odoo database
Used in core15 occurrences across 10 modules, including survey, website_slides, calendar, auth_totp, im_livechat, portal
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0
No-code setupYes, via Odoo Studio (Enterprise)
AlternativesCopyClipboardURL, CopyClipboardButton, url, email

What the Copy to Clipboard field does

The widget wraps the standard char display and appends a small button. Clicking it copies the exact stored value to the clipboard and flips the label to Copied for a moment. That is the entire job, and core uses it everywhere a human needs to move a value into another tool without typos: portal invitation links, TOTP secrets in auth_totp, livechat embed snippets, survey share URLs, calendar feed addresses.

It is also a small curiosity of the codebase: along with its two siblings it is registered under a CamelCase name, CopyClipboardChar, where nearly every other widget in the registry is snake_case. The registry is a plain case sensitive map, so the capitalization is part of the API.

What this means for your team

Copy buttons are about error elimination, not convenience. Any value your team relays into email, chat or another system by selecting text will eventually be relayed with a missing character: an API key that fails, a payment reference that does not reconcile, a tracking link that 404s. A copy button reduces that class of support ticket to zero for the cost of one widget attribute.

The places it pays for itself fastest are customer facing values, credentials, and references consumed by other software: contract numbers quoted in bank transfers, webhook URLs pasted into third party dashboards, license keys sent to customers. If a value's only purpose is to be pasted somewhere else, it should carry this widget, and values that must not leave the screen on certain records can disable the button per record with the disabled expression.

Setting it up in Odoo Studio (no code)

Odoo Studio (Enterprise) has a first class path for this widget.

  1. Open the form in Studio.

  2. Drag a Text field onto the form, or select an existing text field.

  3. In Properties, set Widget to Copy to Clipboard.

  4. Optionally set Readonly. Most copy targets are computed or system generated values, and locking them makes the field a pure handoff point.

The same widget entry appears for Multiline Text fields in Studio's list, and the button copies the full stored value either way.

What Studio cannot do here

Studio stops at attaching the widget. The two refinements it cannot reach both live on the field node in XML:

Relabeling the button takes the string attribute. Setting string="Copy link" renames the button, since the widget uses the field's label text as the button caption.

Disabling the button conditionally takes the disabled attribute with a Python expression, evaluated against the record. Studio's conditional tools cover field visibility, not this button state.

Both are one line view changes, the kind of thing bundled into any Odoo customization pass rather than billed on its own.

Working examples

Standard copy field

<field name="access_token" widget="CopyClipboardChar" readonly="1"/>

Custom button label

<field name="share_url"
       widget="CopyClipboardURL"
       string="Copy link"/>

Disable copying until the record is confirmed

<field name="payment_reference"
       widget="CopyClipboardChar"
       disabled="state != 'confirmed'"/>

Button only, value hidden

<field name="api_secret"
       widget="CopyClipboardButton"
       options="{'btn_class': 'secondary'}"/>

The Button variant renders no value at all, only the button, which is the right shape for secrets that should be transferable but never displayed.

One file, three widgets

The 19.0 source file defines one base component and three registered widgets, and knowing which is which saves guesswork:

CopyClipboardChar composes the standard char field plus the copy button with a clipboard icon. Declared supportedTypes is char only.

CopyClipboardURL composes the URL field instead, so the value renders as a clickable link with a link icon on the button. The clipboard still receives the raw stored value.

CopyClipboardButton renders only the button. It declares no supported types, and its one option, btn_class, feeds the Bootstrap button class with a default of primary. That option is new in 19.0.

Shared machinery worth knowing: the button label falls back to Copy unless the string attribute overrides it, the success state briefly shows Copied, and the disabled attribute is re-evaluated per record against the record's context, including unsaved values. The copy itself goes through the browser clipboard API, which browsers only expose in secure contexts, so an Odoo instance served over plain HTTP on a LAN will render the button but the copy can fail. Modules also ship their own derivatives, such as hr_recruitment's variant for interview links, so the trio here is the core surface, not the whole family.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. Inline link styling and new icon set on the development branch, functionally unchanged. Details below.
Odoo 19.0VerifiedVerified against the shipped source. btn_class appears on the Button variant.
Odoo 18.0VerifiedSame attributes and behavior for the Char and URL variants. The Button variant had no btn_class option.

Upgrade note for 18 to 19. Nothing to change in your views. The string and disabled attributes behave the same, and the only addition is btn_class on the Button variant. Internal plumbing of the label pass through changed, which only matters if you patched the component.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. These notes come from the public development branch, which remains unstable until feature freeze, and this page is re-verified after release.

The button restyles from a boxed button to an inline link. The class string moves from btn-sm to btn-link btn-link-inline, so the copy affordance sits flush with the value instead of standing beside it as a bordered button. Screenshots in internal documentation will age accordingly.

The icons leave FontAwesome. Both the clipboard icon and the URL variant's link icon are replaced by the assignment glyph from the new icon set, part of the same iconography migration we have tracked across other widgets on the development branch.

No functional changes are visible: registry names, attributes and the disabled expression all carry over.

Common problems and fixes

SymptomCause and fix
The widget renders as a plain text fieldThe registry name is case sensitive and was written in snake_case or lowercase. Use widget="CopyClipboardChar" exactly, capitals included.
The copy button does nothing on some recordsThe disabled attribute expression evaluates truthy on those records. Check the expression against the record's current field values, including unsaved edits.
Button renders but copying fails silentlyThe browser clipboard API requires a secure context, and the instance is served over plain HTTP. Serve Odoo over HTTPS, or on localhost for development.
The value shows but you wanted only a buttonCopyClipboardChar always renders the value alongside the button. Switch to CopyClipboardButton, which hides the value entirely.
Button label reads Copy instead of your labelThe custom label was placed in options rather than the string attribute. Set string="..." on the field node. This widget reads no options.
Copied value differs from what is displayedThe URL variant displays a clickable link but always copies the raw stored value. Expected. Store exactly what users should paste.

Copy to Clipboard field vs the alternatives

WidgetBest forKey difference
CopyClipboardCharValues users paste elsewhere: tokens, references, linksShows the value plus a one-click copy button
CopyClipboardURLLinks that should be clickable and copyableRenders the value as a hyperlink, link icon on the button
CopyClipboardButtonSecrets that move but should not be displayedButton only, value hidden, styled via btn_class
urlLinks that only need clickingClickable link, no copy affordance
emailAddress valuesmailto link, no copy button

Choose by what the reader should do with the value: click it, copy it, or both. URL wants clicking, CopyClipboardURL wants both, and the Button variant is for values that should move without ever being shown.

Frequently asked questions

How do I add a copy to clipboard button in Odoo without code?+
In Odoo Studio, select or add a Text field and set its Widget to Copy to Clipboard. That is the CopyClipboardChar widget. In plain XML the equivalent is widget="CopyClipboardChar" on the field.
Why is the widget name CamelCase?+
Historical accident preserved for compatibility. The three clipboard widgets are registered as CopyClipboardChar, CopyClipboardURL and CopyClipboardButton in an otherwise snake_case registry, and the registry lookup is case sensitive, so the exact spelling is mandatory.
How do I change the text on the copy button?+
Set the string attribute on the field node, for example string="Copy link". The widget uses the field's label text as the button caption and falls back to Copy.
Can I disable the copy button for certain records?+
Yes. The disabled attribute accepts a Python expression evaluated against the record, such as disabled="state != 'confirmed'". While truthy, the button is inert. This is an attribute, not an option.
What is the difference between CopyClipboardChar and CopyClipboardURL?+
Presentation only. The URL variant renders the value through the URL field, so it displays as a clickable link and the button carries a link icon. Both copy the raw stored value to the clipboard.
How do I show only a copy button without the value?+
Use CopyClipboardButton. It renders the button alone and accepts a btn_class option, defaulting to primary, to control the Bootstrap styling. Since Odoo 19 that is the one option in the whole clipboard family.
Does the copy button work in list views?+
Yes, the widget renders in list cells as well as forms. Most core usage is on forms and share wizards, where a single prominent value is being handed to the user.
Will CopyClipboardChar change in Odoo 20?+
The development branch shows a restyle to an inline link button and new iconography replacing FontAwesome, with no functional change to the registry names or attributes. Final behavior is confirmed once Odoo 20 ships in late September 2026.

Building portals and integrations people can actually use?

Copy buttons, share links, tokens and embed snippets are the last mile of a portal or API rollout, and the place where sloppy UX turns into support tickets. We design Odoo portals, share flows and integration touchpoints where values move cleanly between systems and humans.

Book a free consultation

How this page was produced

This page was verified by reading copy_clipboard_field.js in the Odoo 19.0 web module end to end, covering all three registered widgets, their extractProps and the disabled expression handling, then diffing the same file against 18.0 and against the public development branch for the version and Odoo 20 notes. Studio steps follow the 19.0 Studio fields documentation, which lists Copy to Clipboard for text fields. Corrections are welcome via our contact page.