Skip to main content
iVentureTeam

barcode_handler

An invisible field that renders nothing and exists purely to catch barcode scans into a field. Odoo 20 removes it, and barcode handling moves out of the field layer entirely.

September 18, 2026Updated September 18, 20264 min read
Technical namebarcode_handler
Field typesany (undeclared)
Viewsform
Modulebarcodes, installed with Inventory and similar apps
Used in core2 uses in Odoo 19 Community. Zero in Odoo 20, where the widget no longer exists.
VersionsOdoo 19.0
No-code setupNo. There is no Studio entry for this widget.
Alternativesfield_float_scannable, many2one_barcode, char

What the barcode_handler widget does

This is one of the few Odoo widgets that deliberately draws nothing:

export class BarcodeHandlerField extends Component {
    static template = xml``;
    static props = { ...standardFieldProps };
    setup() {
        const barcode = useService("barcode");
        useBus(barcode.bus, "barcode_scanned", this.onBarcodeScanned);
    }
    onBarcodeScanned(event) {
        const { barcode } = event.detail;
        this.props.record.update({ [this.props.name]: barcode });
    }
}

The template is an empty tagged literal. Placing the field on a form adds no markup at all. What it adds is a listener: while the form is open, any barcode scanned anywhere on the page is written into this field, which then typically triggers an onchange on the server.

That pattern is how Odoo 19 turns a scan into a record change without a visible input to focus.

What this means for your team

Warehouse and point-of-sale screens live or die on whether a scan does the right thing without anyone touching a keyboard. This widget was the mechanism: put the invisible field on the form, let the server's onchange decide what a scanned code means in that context.

If you are on Odoo 19 and this is in your views, it is working and there is nothing to fix. If you are planning an Odoo 20 upgrade and barcode scanning is part of your operation, this page is a warning: the mechanism changed, and it is not a rename.

Working examples

The Odoo 19 pattern, an invisible field that catches scans:

<field name="barcode_scanned" widget="barcode_handler"/>

The field usually has an onchange on the Python side that interprets the scan for the current model.

What Odoo 20 does instead

We checked the 20.0 branch directly. The registration barcode_handler does not exist, and addons/barcodes/static/src/barcode_handler_field.js is gone.

It is tempting to read barcode_handlers in Odoo 20 as the successor, because the name is one letter away. It is not. That registration goes into a different registry:

registry.category("services").add("barcode_handlers", barcodeGenericHandlers);

A service, not a field widget. Its file is built around macros and DOM action helpers that click buttons and fill inputs, which is a different design: rather than routing a scan into a field and letting a server onchange interpret it, Odoo 20 drives the interface directly.

The practical consequence is that there is no drop-in replacement and no rename to apply. A view carrying widget="barcode_handler" in Odoo 20 finds no registration; Odoo logs a missing-widget warning in the console and falls back to rendering the field by its type, which for a char field means a visible text input appearing where nothing used to be.

So the failure is visible rather than silent, which is a small mercy. If you rely on barcode scanning, budget real time for this in an Odoo 20 upgrade: it is a rework of how scans reach your logic, not a search and replace.

Version compatibility

VersionStatusNotes
Odoo 19.0VerifiedVerified against the shipped 19.0 source.
Odoo 20.0Not availableRemoved. Barcode handling moved to a service, with no widget replacement.

Present and working in Odoo 19, absent in Odoo 20.

What is changing in Odoo 20

Removed. The widget is not registered on the 20.0 branch and its source file is deleted. There is no field widget that replaces it.

Barcode handling moves into the services registry as barcode_handlers, built around macros that act on the interface rather than a field that receives a value. Any view using widget="barcode_handler" will render the underlying field with its default widget instead, which usually means an unexpected visible input.

Its sibling field_float_scannable was removed in the same release, so a database using both loses both at once.

Common problems and fixes

SymptomCause and fix
An unexpected text input appears on a form after upgrading to Odoo 20The barcode_handler registration no longer exists, so the field renders with its default widget. Remove the field from the view and rework the scan flow against the Odoo 20 barcode service.
Scans stopped reaching the record after upgradingSame cause. The invisible listener is gone. There is no drop-in replacement. Plan the rework rather than searching for a renamed widget.
The field is invisible on Odoo 19 and appears to do nothingWorking as designed. Its template is empty and its effect is the value it writes on scan. Check the field's onchange on the Python side; that is where a scan is interpreted.

Barcode_handler widget vs the alternatives

WidgetBest forKey difference
barcode_handlerCatching barcode scans into a field, on Odoo 19Renders nothing at all, and does not exist in Odoo 20
field_float_scannableA visible quantity field that responds to scansAlso removed in Odoo 20
many2one_barcodeSelecting a record by scanning its barcodeVisible picker, and still present in Odoo 20
charA plain visible code fieldNo scan listener

On Odoo 19 there is no alternative, because nothing else provides an invisible scan sink. On Odoo 20 the replacement is architectural: build against the barcode service rather than looking for a widget. If you need an interim step, a small custom widget reproducing the Odoo 19 behavior is only a few lines, since the original was too.

Frequently asked questions

Does barcode_handler still work in Odoo 20?+
No. The registration and its source file are both gone from the 20.0 branch. A view using it will render the field with its default widget, which usually means an unexpected visible input.
What replaced barcode_handler in Odoo 20?+
Nothing in the fields registry. Odoo 20 registers barcode_handlers in the services registry, built around macros that act on the interface directly rather than writing a scanned value into a field. It is a rework, not a rename.
Why does the barcode_handler field render nothing?+
Its template is an empty tagged literal, xml``. The widget exists purely for its side effect: it listens on the barcode service bus and writes any scanned code into its own field.

Barcode scanning in your Odoo 20 upgrade path?

Scanning is where an Odoo 20 upgrade gets expensive, because the mechanism moved out of the field layer and no script will rename it for you. We scope that rework against the 20.0 branch before it becomes a go-live surprise.

Get an upgrade audit

How this page was produced

Verified by reading addons/barcodes/static/src/barcode_handler_field.js on the 19.0 branch of a local clone of the official Odoo repository, quoted in full above. Its absence in Odoo 20 was confirmed by listing addons/barcodes/static/src/ on the 20.0 branch and by a registry diff across both trees. The barcode_handlers service registration was read directly from addons/barcodes/static/src/barcode_handlers.js on the 20.0 branch, where the registry category is services rather than fields. Corrections welcome via our contact page.