Odoo Help

0

0
5 Answers
1
Avatar

Axel Mendoza

--Axel Mendoza--
13613
| 8 8 10
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full-time employee trying to understand what to do and how

Reach me at aekroft@gmail.com

Axel Mendoza
10/3/15, 2:52 PM

There is an Odoo controller for reports barcode images, as docs says at: https://www.odoo.com/documentation/8.0/reference/reports.html


Barcodes are images returned by a controller and can easily be embedded in reports 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)"/>

That controller accepts this types of barcodes: 

:param type: Accepted types: 'Codabar', 'Code11', 'Code128', 'EAN13', 'EAN8', 'Extended39', 'Extended93', 'FIM', 'I2of5', 'MSI', 'POSTNET', 'QR', 'Standard39', 'Standard93', 'UPCA', 'USPS_4State'

Your image could be defined like:

<img t-att-src="'/report/barcode/EAN13/%s' % prod.ean13"/>

0
Jordy Blankestijn
7/18/18, 10:53 AM

Answer by @Axel Mendoza still works like a charm on Odoo 11. 

If you run into parse errors on the '&' char you should change this for unicode. So the code should be like:

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

Ask a Question
Writer
408
E.M.
Keep Informed
2 follower(s)
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.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now