Metadata-Version: 2.1
Name: odoo-addon-barcode_scanner
Version: 18.0.1.0.0.2
Requires-Python: >=3.10
Requires-Dist: odoo==18.0.*
Summary: Base scanning framework: client action, registries, scanner input and hooks
Home-page: https://github.com/OCA/barcode-interface
License: AGPL-3
Author: Binhex, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 18.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Description-Content-Type: text/x-rst

.. 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:96e81cc508ac1ddf3e9c81b9c5ca09b6f5344d61150e50945029f8a877cf1d21
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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