Odoo Help

Welcome!

This community 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.

2

How to generate barcode in qweb report?

By
Raj
on 2/5/15, 6:54 AM 6,288 views

If u need to print single barcode then go for qweb.. else use use rml beacuse qweb is slow for enormous process...

Anand
on 2/6/15, 1:27 AM

Good Questions.

Mohit Kotak (MK)
on 2/20/15, 6:38 AM
7

Stephen Mack

--Stephen Mack--
5023
| 8 8 9
Santiago, Chile
--Stephen Mack--

Some people call me a karma whore, I only ask for 10 points if you like my answer and 15 if I happen to get it correct.

Stephen Mack
On 2/5/15, 7:33 AM

Add barcodes

  • Barcodes are images returned by a controller
  • Quite easy thanks to the Qweb syntax

<img t-att-src="'/report/barcode/QR/%s' % 'My text in qr code'"/>

  • More parameters can be passed as a query string

<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s'%('QR', 'text', 200, 200)"/>

Accepted Types:

  • 'Codabar', 'Code11', 'Code128', 'EAN13', 'EAN8', 'Extended39', 'Extended93', 'FIM', 'I2of5', 'MSI', 'POSTNET', 'QR', 'Standard39', 'Standard93', 'UPCA', 'USPS_4State'

img/func7.png

From OpenDays 2014 presentation by Simon Lejeune.

See a live demonstration on: demo.odoo.com/report/barcode/Code128/AZWERTY

or demo.odoo.com/report/barcode/?type=QR&value=text&width=200&height=200

In my case, I had to update the reportlab package to get it to work. Get pip, if you don't have it already, then try "pip install reportlab --update".

Jeff Beidler
on 2/20/15, 1:52 PM

Hey Jeff, i think you mean "pip install reportlab --upgrade" :). But thank you for solving my Problem. I also need to run "apt-get install python-dev".

Andre
on 3/16/15, 9:00 PM

Jeff n Andre @thanks a lot! you saved my day!

Tidy Way
on 10/24/15, 11:55 PM

This link is also helpful nad works for me: https://github.com/odoo/odoo/issues/3234

Ubaid
on 1/6/16, 12:57 AM
0
Ibrar Ahmad
On 1/18/16, 4:29 AM

@Stephen Mack

 The way you mentioned is fine for a single barcode image to be inserted in the report but what to do if we want to add a dynamic barcode and image for every new order ?

I need to do that for the purpose of scanning a customer order in a tailor shop when he comes to collect his order. When a customer comes, he take a reciept of his order and then when he come back to collect the completed order after a mentioned time, then we should be able to search the order through barcode scanner. For that every order must have a unique barcode. 

0
Marc Wagener
On 1/20/16, 11:23 AM

<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', move.product_id.ean13, 600, 100)" style="width:300px;height:50px"/>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

6 follower(s)

Stats

Asked: 2/5/15, 6:54 AM
Seen: 6288 times
Last updated: 11/18/16, 7:49 AM