In latest release of mERP we added possibility to use barcode scanner with built-in camera. As long as our application was originally planned as generic, we made it possible to attach barcode scanner to any one2many field. So first of all lets take a look on how final integration looks like.
How it works?
You can test barcode scanner integration with Odoo yourself on demo server:
- Just click on “Run Demo” button on login screen of mERP
- Click “Create” (plus icon)
- After that you will be allowed to select the product using barcode scanner.
For testing purposes we have used below barcode of iPad Mini:
Source code of the module to apply barcode scanner to “product” field when creating “Stock Move” can be downloaded here.
As I mentioned before, it is possible to add barcode scanner to any one2many field. So, for example, you may add barcode scanner to select Source Location and Destination Location by simple configuration. Now lets take a look on how it can be done.
Lets have a look on how xml configuration of the “Product” field with attached barcode scanner looks like:
field name=“product_id” barcode_field=“ean13” barcode_type=“ean13” widget=“barcode_scanner”
Let’s discuss each attribute one by one:
widget=“barcode_scanner” – that is required field. It tells mERP that barcode scanner can be used in order to specify value for that field. If widget attribute is specified with value barcode_scanner, it means that mERP will display scan icon near the field.
barcode_field=“ean13” – that is required attribute. It should specify name of the field in related model where application will be searching for EAN. For example, in this case field product_id refers to model “product.product”. That model contains field “ean13” that contains code of product in it. That’s why we specified value “ean13”
barcode_type=“ean13” – non-required attribute. It allows to specify what type of barcode is used for that field. In that case I noted that EAN13 is used. But we can use much more code types if desired. List of all supported code formats are specified here document.
Example of the edited string
Note that for QR-code we use “Free text” field that will contain your code.
Special thanks to Techvision Group for help in this feature implementation.
- Download mERP from Google Play
- How to install mERP/mERP Warehouse on EDMK Devices
- About mERP Warehouse app
- Xpansa mobile development department
- Frequently asked questions (FAQ)