
What is QR code ???
A QR code (Quick Response code) is a type of matrix barcode or two-dimensional code designed to be read by smartphones. The code consists of black modules arranged in a square pattern on a white background. The information encoded may be text, a URL, or other data. The QR code is one of the most popular types of two-dimensional barcodes. The QR code was designed to allow its contents to be decoded at high speed. The reason why they are more useful than a standard barcode is that they can store (and digitally present) much more data, including url links, geo coordinates, and text. The other key feature of QR Codes is that instead of requiring a chunky hand-held scanner to scan them, many modern cell phones can scan them.
How QR code can be generated using a python script ?????
First of all you need the python file qrtools.py, copy it in the folder where you running the code. You can get this file at http://code.google.com/p/qtqr/source/browse/qrtools.py. QR code can be generated by a simple python script. To generate a qrcode, create a python file , eg: qrgenerate.py, with the code given below and run the code.
from qrtools import QR
code = u"A QR code is a type of matrix barcode designed to be read by smartphones"
qrCode = QR(data=code)
qrCode.encode()
print qrCode.filenameYou can run the code by typing 'python qrgenerate.py' in the terminal. Please note that the data argument must be a unicode object if you are going to use non-ascii characters. To encode the text we need to call the encode() method of our new QR object. By printing the filename attribute, we can get path of the created file.
You can modify the attributes of the generated QR Code by passing personalized values to the other parameters of the __init__ method, such as pixel_size, margin_size.
ie, qrCode = QR(data=code, pixel_size=10, margin_size=4 )
How QR code is incorporated in OpenERP ?????
QR code can also be generated with OpenERP. To generate a QRcode in OpenERP, install the module tr_barcode. On installing this module, there will be a new menu Barcode. Goto the menu Barcode/Barcode/Barcode and Create a new record by entering the text at Barcode field and select Type as 'QR'. On pressing the button "Generate Barcode Image", the image will be created at the Data field. The module tr_barcode is attached.

| Attachment | Size |
|---|---|
| tr_barcode.zip | 1.33 MB |
Perfect post. Learn how to
Perfect post. Learn how to incorporate QR codes in your web apps to deliver quick information directly to your users' mobile device http://blog.caspio.com/web_apps/4-ways-to-use-qr-codes-in-your-web-apps/
Hi Janeesh, I wanted to
Hi Janeesh,
I wanted to import the tr-barcode zip file and received the following error:
Error !
Can not create the module file: /home/pathofinder/openerp-server-5.0.9/bin/addons/tr_barcode/.bzr/repository/indices.zip !
Any clue on how to solve this?
Thank's for your feedback.
help pleace .... error
help pleace .... error here
Environment Information :
System : Windows-32bit-SP1,_v.178
OS Name : nt
Operating System Release :
Operating System Version : 32bit
Operating System Architecture : 32bit
Operating System Locale : es_VE.cp1252
Python Version : 2.5.2
OpenERP-Client Version : 6.0.3
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
File "netsvc.pyo", line 489, in dispatch
File "service\web_services.pyo", line 599, in dispatch
File "osv\osv.pyo", line 122, in wrapper
File "osv\osv.pyo", line 176, in execute
File "osv\osv.pyo", line 167, in execute_cr
File "C:\Program Files\OpenERP 6.0\Server\addons\tr_barcode\tr_barcode.py", line 53, in generate_image
File "C:\Program Files\OpenERP 6.0\Server\addons\tr_barcode\tr_barcode.py", line 42, in get_image
File "reportlab\graphics\shapes.pyo", line 780, in asString
File "reportlab\graphics\renderPM.pyo", line 656, in drawToString
File "reportlab\graphics\renderPM.pyo", line 651, in drawToFile
File "reportlab\graphics\renderPM.pyo", line 637, in drawToPMCanvas
File "reportlab\graphics\renderPM.pyo", line 50, in draw
File "reportlab\graphics\renderbase.pyo", line 198, in draw
File "reportlab\graphics\renderPM.pyo", line 93, in initState
File "reportlab\graphics\renderPM.pyo", line 87, in applyState
File "reportlab\graphics\renderPM.pyo", line 368, in setFont
File "reportlab\graphics\renderPM.pyo", line 221, in _setFont
RenderPMError: Can't setFont(Times-Roman) missing the T1 files?
Originally : makeT1Font() argument 2 must be string, not None
in openerp 6.0.3
The solution is to download
The solution is to download the fonts from the reportlab site Or use the link below.
http://www.findthatfile.com/search-11092018-hZIP/winrar-winzip-download-...
Now, unzip the files to the fonts directory in reportlab.
I am using Ubuntu10.04. In my case the path is /usr/lib/python2.6/dist-packages/reportlab/fonts
Extract the pfbfer.zip file
Extract the pfbfer.zip file in the attached module to the fonts directory in reportlab. In ubuntu the path is /usr/lib/python2.6/dist-packages/reportlab/fonts.
Your approach to this topic
Your approach to this topic is unique and informative. I am writing an article for our school paper and this post has helped me. Thanks.