Odoo Help


UPC barcodes in POS frontend

on 4/22/13, 2:58 PM 5,534 views

Hi, Yesterday I had to find quick solution for using UPC barcodes in POS frontend. What i did first was to install the chricar_product_gtin module to be able to assing UPC barcodes to products. Bu then I needed to be able to scan them and recognize them in POS frontend. I am not really a developer and the first thing I could figure out watching at the code of devices.js was to add after if (codeNumbers.length === 13) { on line:485 the code:

else if (codeNumbers.length === 12) {

if (self.check_ean(codeNumbers.join(''))) {

self.on_ean(codeNumbers.join('')); codeNumbers = []; }}

and then change the line:316 to if(code.length !== 13 && code.length !== 12)

So basically it allows 12 number barcodes to be read and if after the 12-th digit it validates it continues as 12-digit (UPC) barcode if not than continues as usual.

It works great but there is one trap: if by chance the first 12 digits of EAN13 barcode make valid UPC code it doesn't work. Actually it happened that in our store we have quite a few products with EAN13 barcode which the first 12 digits by chance construct a valid UPC code.

Is there an easy way to go around this?

I see that devices.js looks at the time interval between the keys to recognize when we have a barcode reader. I was thinking that if we can check for a longer interval after the 12-th digit like this we'll know that it is a UPC barcode and not a part of EAN13 code. But I couldn't figure it out how to do that.

Any ideas?

Mario Arias Badila
On 8/4/13, 1:36 PM

Hi, Some bar code readers like Honeywell allow for a setting that "converts" UPC barcodes to EAN13 ones, by transmitting a leading zero before the code...

See http://www.honeywellaidc.com/CatalogDocuments/00-02544%20Rev%20K%202-11.pdf on page 9-1

Then, you need to register the "new" code on OpenERP, and from there on you will be able to recognize them on POS terminal with no change to the code...


Thanks a lot, it is exactly Honeywell!

on 8/5/13, 8:23 AM
OpenERP Vietnam
On 7/25/14, 4:54 AM

It was patched at: https://blueprints.launchpad.net/openobject-addons/+spec/pos-7-custom-ean-barcode

You only replace file devices.js by this content




| 3 2 6
Gandhinagar, India

Having 8+ years of OpenERP Experience. We are Specialized in OpenERP/CRM Solutions, software development, Web development, E commerce solutions & other open source solutions.

Skype : acespritech

Email : info@acespritech.com

On 4/24/13, 6:56 AM

There are some customizations required in PY files and yes you are right, device.js file too.

We have created a module which allow to use any barcode machine.

Acespritech Solutions Pvt. Ltd.
Mail: info@acespritech.com
Skype: acespritech.

Where can I find module ??

Jagdish Panchal
on 7/25/14, 5:14 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 4/22/13, 2:58 PM
Seen: 5534 times
Last updated: 3/16/15, 8:10 AM