OdooWiki OCA HUB

Barcode Scanner

barcode_scanner folder_open OCA/barcode-interface open_in_new
Hidden License: AGPL-3

This module is the base framework of the Barcode suite: a fast, full-screen scanning application shell for Odoo that other modules extend.

It ships no business logic of its own. Instead it exposes the building blocks feature modules plug into, the same way Odoo widgets self-register:

  • a full-screen client action and a lightweight in-app router;
  • registries for screens, scan handlers and home-screen menu tiles (barcode_screens, barcode_scan_handlers, barcode_menu_tiles);
  • the barcode input service (hardware/keyboard wedge), audio/vibration feedback, an ORM/API wrapper and shared hooks.

Install a feature module on top — such as barcode_stock — to get actual warehouse operations.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Adds a full-screen "Scanner" application to Odoo that captures barcodes from handheld scanners and keyboard-wedge devices, shows what was read, and gives other modules a framework to build scanning screens on top of.

This module is the foundation of a barcode scanning suite rather than a ready-made warehouse tool. Installing it adds a "Scanner" entry in Odoo's apps menu that opens a full-screen scanning application, separate from the normal back office.

What users see: - A home screen with a greeting, the user's name and avatar, and tiles for the scanning features installed on top (none are included here). - A small dark toast at the top of the screen showing the exact code the scanner just read, so a misread or a dead scan is visible instead of silent. - Optional sound, vibration and screen-flash feedback for success, warning, error and info events.

How scanning works: the app listens for barcodes from hardware scanners and Android handheld terminals while it is open, and stops listening when it is closed so it never interferes with the rest of Odoo. It does not steal focus from fields the user is deliberately typing in. Codes shorter than three characters are ignored. A built-in parser recognises 13-digit EAN13 codes; other modules can add richer parsers.

Automatic behaviours: if a scanned code is not recognised by any installed feature, a warning "Barcode not recognized" is shown. Server errors are turned into short readable messages instead of raw technical errors.

It stores no business data of its own: no new database tables, no reports, no scheduled jobs. It only provides the screen, the scanning input, the navigation between screens and shared helpers that other barcode modules plug into.

Depends on

web

Menus it adds

Scanner

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. The module is very large and only part of the code was read. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 1 confirmed, 8 with no information of 9 versions.

Sources · Odoo 18.0

Confirmed on 2026-11-03 in branch 18.0 of OCA/barcode-interface.

terminal Installation and usage

OCA documentation · Odoo 18.0

barcode_scanner is a framework and is not useful on its own: install a feature module such as barcode_stock to get actual operations.

To build your own feature module, register your pieces into the framework registries — no change to the base module is required.

Register a screen:

import {barcodeScreens} from "@barcode_scanner/js/registries";

barcodeScreens.add("my_screen", {component: MyScreen});

Register a scan handler (tried in sequence order; the first that returns a truthy value consumes the scan):

import {barcodeScanHandlers} from "@barcode_scanner/js/registries";

barcodeScanHandlers.add("my_handler", {
    async handle(barcode, parsed, {api, navigate, notify}) {
        // return true when handled
    },
}, {sequence: 50});

Register a home-screen tile:

import {barcodeMenuTiles} from "@barcode_scanner/js/registries";

barcodeMenuTiles.add("my_tile", {
    label: "My Screen",
    icon: "fa-cube",
    action: ({navigate}) => navigate("my_screen"),
}, {sequence: 50});

Register a barcode parser (tried in sequence order before the built-in EAN13 one; return null to let the next parser try):

import {barcodeParsers} from "@barcode_scanner/js/registries";

barcodeParsers.add("my_symbology", (barcode) => {
    // return {type: "...", value: "<product code>", ...} or null
}, {sequence: 20});

Register a startup task, for data your module needs before the first scan (barcode_gs1 reads its nomenclature this way). Tasks are awaited when the app opens; one that fails is logged and skipped:

import {barcodeStartupTasks} from "@barcode_scanner/js/registries";

barcodeStartupTasks.add("my_config", (env) => loadMyConfig(env.services.orm));

Read scans in a screen with the useBarcodeHandler hook. The barcode service counts the components that do (readers.count, reactive), so a scan source such as a camera button can offer itself only while a screen reads scans:

import {useBarcodeHandler} from "@barcode_scanner/js/hooks/use_barcode_handler.esm";

useBarcodeHandler({onScan: (barcode, parsed) => this.onScan(barcode, parsed)});

No verified information in OCA: Installation, Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.