Skip to main content
iVentureTeam

peppol_non_focusable_selection

A selection widget whose entire purpose is to not take focus. One attribute changed in an inherited template, so the Peppol registration form can put the cursor where a user actually types.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 27, 2026Updated August 27, 20265 min read
Technical namepeppol_non_focusable_selection
Field typesselection
Viewsform
Moduleaccount_peppol, the Peppol electronic invoicing app
Used in core1 occurrence, the Peppol registration wizard in account_peppol
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0
No-code setupNo. It is a view XML widget with a single, very specific purpose
Alternativesselection, filterable_selection, radio

What the non-focusable selection does

Odoo's selection widget renders a searchable menu. When that menu is used on a form, its search input is a real focusable element, which means it participates in the tab order and can capture the initial focus of a dialog. Usually harmless. On the Peppol registration wizard it is not.

That wizard asks for an electronic address scheme, which is a selection, and immediately after it the address itself, which is what the user has to type. The address field is marked as the default focus. Without this widget, the scheme dropdown's search input can take the cursor first, so the user starts typing into a filter box instead of the field they came to fill.

The widget solves it in the smallest possible way. It subclasses the select menu, inherits the search template, and sets a negative tab index on the input. Nothing else about the selection field changes: same values, same options, same saving behavior.

What this means for your team

This is a one-line accessibility and flow fix, and it is worth reading as an example rather than a feature. Compliance wizards are exactly the screens where a stray focus costs money: users are already unsure what a Peppol scheme is, and a form that eats their first keystrokes reads as broken software rather than as an unfamiliar field.

The general lesson for custom Odoo work is that default_focus only wins if nothing else in the dialog grabs focus first. Searchable dropdowns, embedded editors and iframes all can. When a form has one obvious field to type into, it is worth checking the actual tab order rather than assuming the attribute is enough.

Supported options in Odoo 19

The widget declares no options of its own. It spreads the selection widget's descriptor unchanged, so the option below is inherited and behaves exactly as it does on the base widget. Read from the widget's source file and the base selection field, Odoo 19.0.

OptionTypeWhat it does
placeholder_fieldfieldInherited from the selection widget. Shows another field's value as a hint when this one is empty. Unchanged by this widget.

The tab-order change is not configurable. The negative tab index is written into an inherited template, so there is no option to keep the search input focusable. If you want the standard behavior, use the plain selection widget.

Working examples

The core usage

<field name="peppol_eas"
       widget="peppol_non_focusable_selection"
       placeholder="Peppol ID" nolabel="1"/>
<field name="peppol_endpoint" nolabel="1"
       default_focus="1"/>

The pair is the point. The scheme dropdown steps aside so the endpoint input can claim the cursor.

Reusing it elsewhere

<field name="country_code"
       widget="peppol_non_focusable_selection"/>
<field name="vat" default_focus="1"/>

Nothing in the widget is Peppol-specific beyond its name and the module it ships in.

The base behavior, for comparison

<field name="peppol_eas" widget="selection"/>

Same values and same options, but the dropdown's search input stays in the tab order.

Two classes, two templates, one attribute

There are two classes and two templates, and together they add up to a single attribute. The field class subclasses the standard selection field and replaces one entry in its components map: the select menu becomes a subclass whose template redirects the search block to a locally inherited version. That inherited template's only edit is a negative tab index on the input.

The indirection exists because the search block is a separate template inside the select menu. Overriding the field's own template, which is what Odoo 18 did, means keeping a copy of a template that belongs to another component and re-checking it every version. Overriding the component and inheriting only its search block, which is what Odoo 19 does, is narrower and survives changes to the rest of the menu.

Worth being precise about what a negative tab index does: the element is skipped by keyboard tabbing and does not receive automatic focus, but it can still be clicked and can still be focused programmatically. So opening the dropdown with the mouse and typing into its filter still works exactly as before. Only the tab order changes.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. Byte-identical to Odoo 19 on the development branch.
Odoo 19.0VerifiedVerified against the shipped source. Overrides the select menu component and inherits only its search template.
Odoo 18.0VerifiedFirst version. Same effect, achieved by overriding the field's own template instead.
Odoo 17.0Not availableWidget does not exist.
Odoo 16.0Not availableWidget does not exist.

Upgrade note. View XML is unchanged between Odoo 18 and Odoo 19. The internal structure is not: Odoo 18 overrode the field's own template with a copy, while Odoo 19 overrides the select menu component and inherits only its search block. Any custom module that patched the Odoo 18 template needs rewriting against the new structure.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The development branch is unstable and can still change; we re-verify the page after release.

Byte-identical. The widget file on the development branch matches Odoo 19 exactly, which is unusual in a cycle that touched most field widgets. It survives untouched because it declares no props of its own and only redirects a template.

Common problems and fixes

SymptomCause and fix
The cursor still lands in the dropdownAnother element in the dialog is claiming focus, or the neighboring field has no default-focus attribute. Add default_focus="1" to the field that should receive the cursor and check for other focusable widgets before it.
I cannot tab into the dropdown at allIntended. A negative tab index removes the search input from the tab order. Open the dropdown with the mouse, or use the plain selection widget if keyboard access to the filter matters.
Missing widget errorThe Peppol module is not installed in that database. Install account_peppol, or use the plain selection widget.
A patch stopped working after upgrading to Odoo 19Odoo 18 overrode the field template; Odoo 19 overrides the select menu component instead. Rewrite the patch against the new structure.
The dropdown offers no valuesThe selection field itself is empty or filtered, which is unrelated to this widget. Check the field definition; the widget changes only the tab order.

Non-focusable selection vs the alternatives

WidgetBest forKey difference
peppol_non_focusable_selectionA selection field sitting in front of the input that should receive focusTakes the dropdown's search input out of the tab order and changes nothing else
selectionEvery other selection fieldIts dropdown search input stays focusable and in the tab order
filterable_selectionSelections that need their values narrowedFilters the available values rather than changing focus behavior
radioShort choice listsNo dropdown and no search input at all

Use the plain selection widget everywhere else. This one is worth reaching for only when a searchable dropdown sits in front of the field that should receive focus, which is a layout problem before it is a widget problem. Rearranging the form so the typed field comes first solves it without any widget at all.

Frequently asked questions

What does peppol_non_focusable_selection actually change?+
One attribute. It subclasses the select menu used by the selection widget and inherits its search template to set a negative tab index on the search input, so that input is skipped by tabbing and by automatic focus.
Why does the Peppol wizard need it?+
The field immediately after the scheme dropdown is marked as the default focus. Without the change, the dropdown's search input can take the cursor when the wizard opens, and the user's first keystrokes go into a filter box.
Can I still search inside the dropdown?+
Yes. A negative tab index removes the element from the tab order but not from the page. Clicking the dropdown and typing works exactly as before.
Does it support options?+
None of its own. It spreads the selection widget's descriptor unchanged, so the base options behave normally.
Is it Peppol-specific?+
Only in name and module. The behavior is generic, so it works on any selection field, as long as the account_peppol module is installed.

Peppol or e-invoicing on your Odoo roadmap?

Electronic invoicing mandates arrive with deadlines, and the setup touches your chart of accounts, partner data and document formats at once. We handle Peppol and e-invoicing configuration on Odoo 16 through 19, including the country-specific parts.

Book a free consultation

How this page was produced

The component override, the inherited search template and the negative tab index were read from the widget's JavaScript and template files on the Odoo 19.0 branch, and the reason for it from the Peppol registration wizard view, where the neighboring endpoint field carries the default-focus attribute. The Odoo 18 comparison and the Odoo 20 statement come from the same file on those branches. Spotted an error? Tell us and we will correct the page.