Skip to main content
iVentureTeam

password

The password widget renders a char or text field as a masked input with a reveal button. It is a display convenience, not a security control: the real value is already in the browser.

September 18, 2026Updated September 18, 20264 min read
Technical namepassword
Field typeschar, text
Viewsform, list
Moduleweb, present in every Odoo database
Used in core0 uses in Odoo 19. In Odoo 20 it appears twice, in res_users_views.xml and res_users_identitycheck_views.xml.
VersionsOdoo 19.0, Odoo 20.0
No-code setupNo. There is no Studio entry and no options to set.
Alternativeschar, password_meter, text

What the password widget does

The password widget swaps a normal text input for a masked one and adds a button that toggles between masked and revealed. The button title changes with the state, reading Reveal value when hidden and Hide value when shown.

It supports char and text fields. Internally it uses the standard useInputField hook, so it saves and validates exactly like a plain char field. The only difference is what the user sees.

The descriptor declares no supportedOptions. Its extractProps is a single line that forwards the placeholder it was given, and nothing else.

What this means for your team

Use this when someone will read the screen over a colleague's shoulder: an API key on an integration form, a shared account credential, a license key. It stops the casual glance.

It does not stop anything else, and this is the part worth being clear about with your team. Anyone who can open that form can click the reveal button. Anyone who can open the browser developer tools can read the value without clicking anything. If the value genuinely must not be readable by a user who can see the record, masking is the wrong tool and the field needs an access rule or server-side encryption instead.

Working examples

Basic masking:

<field name="api_key" widget="password"/>

With a placeholder. Note that placeholder is an attribute, not an option:

<field name="api_key" widget="password" placeholder="Paste the provider key"/>

This does not work, and is the most common mistake on this widget:

<!-- wrong: placeholder is not an option, this is silently ignored -->
<field name="api_key" widget="password" options="{'placeholder': 'Paste the key'}"/>

Why this widget is not a security control

Masking happens in the browser, after the value has arrived there. The component's own getter makes this plain:

get displayedValue() {
    return this.props.record.data[this.props.name] || "";
}

The value is read straight out of the loaded record. For it to be there, the server already sent it in the read response. That means three things in practice.

  1. Any user who can open the form can click the reveal button and read the value. There is no permission check on the toggle.
  2. The value is visible in the browser network tab and in the page's JavaScript state whether or not the user ever clicks reveal.
  3. Exports, the developer mode record viewer and the ORM all return the plain value. The widget only affects one input on one form.

If a value must be hidden from users who can otherwise see the record, that has to be enforced on the server: a restricted field with a groups attribute, a separate model behind an access rule, or a value your code writes but never reads back. Odoo's own res.users password is handled that way, not with this widget.

Version compatibility

VersionStatusNotes
Odoo 19.0VerifiedVerified against the shipped 19.0 source. Unused in standard views.
Odoo 20.0VerifiedWidget unchanged. Now used on two res.users views.

The widget itself is unchanged between 19.0 and 20.0. What changed is that Odoo started using it.

What is changing in Odoo 20

The widget is identical in Odoo 20. We diffed the registration and found no options added or removed and no change to supported types.

The interesting change is adoption. In Odoo 19 the widget appears zero times in standard views. In Odoo 20 it appears twice, both on user-facing security screens: res_users_views.xml and res_users_identitycheck_views.xml. So a widget that existed unused in 19 becomes part of the standard user forms in 20.

Common problems and fixes

SymptomCause and fix
A placeholder set in options does not appearplaceholder is a field attribute on this widget, not an option. extractProps reads it from the attribute only. Move it out of options: placeholder="..." directly on the field tag.
A user revealed a value you expected to be hiddenThe reveal button has no permission check, and the value was already sent to the browser. Restrict the field server-side with a groups attribute, or move it behind an access rule. Masking cannot do this.
The widget has no effect on an integer or selection fieldsupportedTypes is char and text only. Check the browser console. Odoo logs a warning for an unsupported type and renders the widget anyway rather than failing.

Password widget vs the alternatives

WidgetBest forKey difference
passwordHiding a credential from a casual onlookerVisual masking only, with a reveal button anyone can click
charOrdinary short textNo masking and no reveal button
password_meterShowing password strength as the user typesScores the value rather than hiding it
textLong multi-line values such as private keysMulti-line, never masked

Pick by what you are defending against. Against a shoulder-surfer, this widget is the right answer and costs nothing. Against a user who should not have the value at all, no widget helps: restrict the field with a groups attribute so the server never sends it, which is the only approach that survives an export or an API call.

Frequently asked questions

Is the Odoo password widget secure?+
No. It masks the input in the browser, but the value is sent to the browser in the record data and can be revealed with a button click or read in developer tools. For real protection, restrict the field server-side with a groups attribute.
How do I add a placeholder to an Odoo password field?+
Use the placeholder attribute on the field tag, not an options entry. The widget's extractProps reads the attribute only, so a placeholder inside options is silently ignored.
What field types does the password widget support?+
char and text. Applying it to another type logs a warning in the browser console and still renders, because Odoo warns rather than errors on a type mismatch.
Does the password widget have any options?+
No. The descriptor declares no supportedOptions, so Odoo Studio shows nothing to configure and any options dictionary is ignored.

Credentials on a form that should not be readable?

Masking stops a glance, not a user. If you are storing API keys, portal credentials or license keys in Odoo, the fix is field-level access rules and a server-side story for secrets. We build that, and we audit what your current views are already exposing.

Request a security review

How this page was produced

Verified by reading addons/web/static/src/views/fields/password/password_field.js on the 19.0 branch of a local clone of the official Odoo repository, and diffing the registration against 20.0. Usage counts come from scanning every XML file in Community, Enterprise and odoo/addons/base for widget="password" in both branches. The claim that masking is display-only is read directly from the component's displayedValue getter, which reads the already-loaded record data. Corrections are welcome via our contact page.