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.

0

How can i output a barcode without left and right margins on a odoo8 qweb report?

By
herbert6453
on 12/18/14, 5:22 AM 1,054 views

I want output a Code128 barcode without margins on a odoo8 qweb report.

Barcodes generated with http://127.0.0.1:8069/report/barcode/?type=Code128&value=10123&width=600&height=100

have a oversized white left and right marigin, together ca. 40% of the image.

 

 

0

Yenthe

--Yenthe--
6676
| 7 7 8
Turnhout, Belgium
--Yenthe--

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

Yenthe
On 12/18/14, 6:17 AM

I presume this is the default report you're using?
You could always write your own report or modify the existing one.

Code for default barcode:

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

Code for custom barcode:

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

With the custom version you can set extra parameters which sounds exactly like what you need. 
You can find more details about Odoo barcodes and reports here: https://github.com/odoo/odoodays-2014/blob/master/v8_reporting_engine/index.rst

Note: I haven't tested the white borders myself, but I'm pretty sure this'll help you a good way along.

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

1 follower(s)

Stats

Asked: 12/18/14, 5:22 AM
Seen: 1054 times
Last updated: 3/16/15, 8:10 AM