Odoo Community Association

Web Ir Actions Client Scan

Beta License: LGPL-3 OCA/stock-logistics-barcode Translate me on Weblate Try me on Runboat

This Odoo module adds a custom barcode scanning action within the web backend. Its purpose is to allow the user to scan a code (for example, using a camera or a scanner) and call a server side method defined in the action params via rpc.

Table of contents

Usage

You can integrate the scanner into your module by defining a client action:

<record id="action_scan_example" model="ir.actions.client">
    <field name="name">Scan Code</field>
    <field name="tag">web_ir_actions_client_scan.scan</field>
    <field name="res_model">example_model</field>
    <field name="params" eval="&quot;{ 'method': 'example_method' }&quot;"/>
</record>

The parameter is as follows:

  • method: Used to determine which method of the res_model will be executed during scanning pocess.

Then trigger it from a button:

<button name="%(action_scan_example)d"
        type="action"
        string="Scan Code"
        class="btn-primary"/>

The action opens a popup where you will have the option to scan a barcode. After completing the scan, the method defined in the action parameters will be executed.

The signature of the method should be like in next code:

@api.model
def example_method(self, barcode):
    pass

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

  • Tecnativa

Contributors

  • Tecnativa:
    • Juan Carlos Oñate
    • Víctor Martínez
    • Carlos Roca

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:

CarlosRoca13

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

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