Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 169 additions & 0 deletions barcode_scanner/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

===============
Barcode Scanner
===============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ba6365d70b631c205696ddd617c9738e11ae52e29ec43c03f6394bdd7815d1a8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fbarcode--interface-lightgray.png?logo=github
:target: https://github.com/OCA/barcode-interface/tree/18.0/barcode_scanner
:alt: OCA/barcode-interface
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/barcode-interface-18-0/barcode-interface-18-0-barcode_scanner
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/barcode-interface&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

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**

.. contents::
:local:

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:

.. code:: js

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):

.. code:: js

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:

.. code:: js

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):

.. code:: js

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:

.. code:: js

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

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

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/barcode-interface/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 <https://github.com/OCA/barcode-interface/issues/new?body=module:%20barcode_scanner%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* Binhex

Contributors
------------

- `Antonio David Ruban Espinal <https://github.com/antoniodavid>`__
- `Zuzanna Elzbieta Szalaty
Szalaty <https://github.com/szalatyzuzanna>`__

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

.. |maintainer-szalatyzuzanna| image:: https://github.com/szalatyzuzanna.png?size=40px
:target: https://github.com/szalatyzuzanna
:alt: szalatyzuzanna

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-szalatyzuzanna|

This module is part of the `OCA/barcode-interface <https://github.com/OCA/barcode-interface/tree/18.0/barcode_scanner>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions barcode_scanner/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The base barcode_scanner module ships no Python models; it is a pure
# JavaScript scanning framework. Feature modules (e.g. barcode_stock) add
# their own models.
44 changes: 44 additions & 0 deletions barcode_scanner/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "Barcode Scanner",
"version": "18.0.1.0.0",
"category": "Hidden",
"summary": "Base scanning framework: client action, registries, scanner "
"input and hooks",
"author": "Binhex, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/barcode-interface",
"maintainers": ["szalatyzuzanna"],
"license": "AGPL-3",
"depends": [
"web",
],
"data": [
"views/action.xml",
"views/templates.xml",
],
"assets": {
"web.assets_backend": [
"barcode_scanner/static/src/scss/barcode_scanner.scss",
"barcode_scanner/static/src/xml/barcode_scanner_templates.xml",
"barcode_scanner/static/src/js/registries.esm.js",
"barcode_scanner/static/src/js/barcode_parser.esm.js",
"barcode_scanner/static/src/js/utils/scan_match.esm.js",
"barcode_scanner/static/src/js/barcode.esm.js",
"barcode_scanner/static/src/js/api.esm.js",
"barcode_scanner/static/src/js/router.esm.js",
"barcode_scanner/static/src/js/store.esm.js",
"barcode_scanner/static/src/js/app.esm.js",
"barcode_scanner/static/src/js/services/feedback_service.esm.js",
"barcode_scanner/static/src/js/hooks/use_barcode.esm.js",
"barcode_scanner/static/src/js/hooks/use_barcode_handler.esm.js",
"barcode_scanner/static/src/js/hooks/use_barcode_dispatcher.esm.js",
"barcode_scanner/static/src/js/hooks/use_inventory.esm.js",
"barcode_scanner/static/src/js/screens/main_screen.esm.js",
],
"web.assets_unit_tests": [
"barcode_scanner/static/tests/**/*",
],
},
"installable": True,
"application": True,
"auto_install": False,
}
59 changes: 59 additions & 0 deletions barcode_scanner/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * barcode_scanner
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-07-31 11:45+0000\n"
"PO-Revision-Date: 2026-07-31 11:45+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: barcode_scanner
#. odoo-javascript
#: code:addons/barcode_scanner/static/src/xml/barcode_scanner_templates.xml:0
msgid "Avatar"
msgstr "Avatar"

#. module: barcode_scanner
#. odoo-javascript
#: code:addons/barcode_scanner/static/src/js/hooks/use_barcode_dispatcher.js:0
msgid "Barcode not recognized"
msgstr "Código de barras no reconocido"

#. module: barcode_scanner
#. odoo-javascript
#: code:addons/barcode_scanner/static/src/js/screens/main_screen.js:0
msgid "Good afternoon"
msgstr "Buenas tardes"

#. module: barcode_scanner
#. odoo-javascript
#: code:addons/barcode_scanner/static/src/js/screens/main_screen.js:0
msgid "Good evening"
msgstr "Buenas noches"

#. module: barcode_scanner
#. odoo-javascript
#: code:addons/barcode_scanner/static/src/js/screens/main_screen.js:0
msgid "Good morning"
msgstr "Buenos días"

#. module: barcode_scanner
#. odoo-javascript
#: code:addons/barcode_scanner/static/src/xml/barcode_scanner_templates.xml:0
msgid "Ready for today's distribution schedule."
msgstr "Listo para la planificación de distribución de hoy."

#. module: barcode_scanner
#: model:ir.actions.client,name:barcode_scanner.action_barcode_scanner
#: model:ir.ui.menu,name:barcode_scanner.menu_barcode_scanner_root
msgid "Scanner"
msgstr "Escáner"
3 changes: 3 additions & 0 deletions barcode_scanner/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions barcode_scanner/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* [Antonio David Ruban Espinal](https://github.com/antoniodavid)
* [Zuzanna Elzbieta Szalaty Szalaty](https://github.com/szalatyzuzanna)
14 changes: 14 additions & 0 deletions barcode_scanner/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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.
59 changes: 59 additions & 0 deletions barcode_scanner/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
``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:

```js
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):

```js
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:

```js
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):

```js
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:

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

barcodeStartupTasks.add("my_config", (env) => loadMyConfig(env.services.orm));
```
Binary file added barcode_scanner/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading