Skip to main content
Odoo Community Association

Barcode Scanner

Beta License: AGPL-3 OCA/barcode-interface Translate me on Weblate Try me on Runboat

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.

Table of contents

Usage

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)});

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Binhex

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

szalatyzuzanna

This module is part of the OCA/barcode-interface project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Metadata

Release files for odoo-addon-barcode-scanner 18.0.1.0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo-addon-barcode-scanner 18.0.1.0.0.10
File Interpreter ABI Platform
odoo_addon_barcode_scanner-18.0.1.0.0.10-py3-none-any.whl Python 3 none any Details

Release files / odoo_addon_barcode_scanner-18.0.1.0.0.10-py3-none-any.whl

Download URL odoo_addon_barcode_scanner-18.0.1.0.0.10-py3-none-any.whl
Size 63.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5ffb6cecfad19688619a5d8faa814eaeccb09588fe0352fe39d591b08771ef9
BLAKE2b-256 checksum
How to use checksums
74bfe2ce0fe1c7504aa9ac92e8258ca76d10b7ba68362d1f31446f60d43901c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for odoo-addon-barcode-scanner 18.0.1.0.0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page