Odoo Help


How to generate barcode in qweb report?

on 2/5/15, 6:54 AM 10,481 views

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

on 2/6/15, 1:27 AM

Good Questions.

http://thewordshops.com/, Mohit Kotak
on 2/20/15, 6:38 AM

Stephen Mack

--Stephen Mack--

| 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'


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".

on 3/16/15, 9:00 PM

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

TidyWay Software Solutions, TidyWay
on 10/24/15, 11:55 PM

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

Ubaid ur Rehman
on 1/6/16, 12:57 AM

Very useful

on 8/17/17, 3:17 AM
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. 

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"/>

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

6 follower(s)


Asked: 2/5/15, 6:54 AM
Seen: 10481 times
Last updated: 2/6/18, 3:24 PM