Giter VIP home page Giter VIP logo

inventree-datanorm-plugin's Introduction

DATANORM Barcode Plugin for InvenTree

If a scanned EAN code is not found for any stored part, your DATANORM files are searched for an article with the EAN. If found, the corresponding part is created with the stored information.

Installation

Install from git repository

To install the plugin from this repository, install the plugin in the GUI from as VCS-URL:

git+https://github.com/ageffgmbh/inventree-datanorm-plugin

To update to the latest version, it is neccessary to execute the following commands on the server:

cd /opt/inventree
source env/bin/activate
invoke update

Install from local package

To install the plugin from a local package, you must be logged on to the Inventree server and have activated the Python environment of Inventree:

source env/bin/activate

The plugin can then be installed from the package file, e.g:

pip install /home/inventree-datanorm-plugin-x.y.z.tar.gz

Setup

After installing the plugin, a (virtual) part must be created in InvenTree, in whose attachment the DATANORM files are attached. It is important that all attachments of the same supplier have the same content in the comment of the attachment (e.g. name of the supplier). This enables the plugin to assign the individual files to an entire data record. This part must then be assigned to the plugin in the plugin settings.

Behaviour

  1. A barcode is scanned (e.g. using a smartphone app).
  2. The internal barcode process of Inventree first tries to resolve the barcode. If no existing part with the barcode is found, the barcode is forwarded to the plugin.
  3. The plugin first checks whether the barcode is a valid EAN-8/EAN-13 code using the checksum.
  4. If the barcode is valid, the EAN/GTIN is searched for in the DATANORM files.
  5. If found, the part is created with the corresponding information from the DATANORM file and the EAN is stored as an alternative barcode and as keyword.
  6. If a manufacturer can be recognized (name in capital letters at the beginning of the DATANORM field "Short text 1", e.g. "HAGER circuit breaker C16"), a manufacturer part is created. If necessary, a new manufacturer is created.
  7. All supplier parts are created on the basis of the DATANORM file(s).
  8. The newly created part is then returned to the barcode scanner (e.g. smartphone app).

Supported Suppliers

  • Alexander Bürkle
  • Sonepar
  • Würth
  • Zander

Known Issues

  • Adding new part can not be restricted to a certain user(-group) since the plugin does not get any information about who scanned the barcode.
  • Assingment of a barcode manually is broken since the frontend (app/web) first triggers the scan function to check if the barcode to be assigned is already in use. Unfortunatelly, the plugin will immediatelly re-assign the barcode to the existing part or create a new part and attach the barcode to that part. Since the plugin does not get any information on the context of the scan action, this can not be avoided.
  • Generation of supplier part urls and fetching of images has to be implemented for all suppliers individually.

Development

Development of the plugin is best done in a VSCode devcontainer, as described here. Install with pip install -e ../inventree-plugin.

The plugin can be tested in the Inventree development container: invoke test -r inventree_datanorm_plugin.tests.

To run the tests, the plugin must first be installed in the InvenTree's venv with pip!

inventree-datanorm-plugin's People

Contributors

fahrjo avatar mittkkoo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.