Hi everyone,
I’m customizing the Employee Badge report (hr.print_employee_badge) in Odoo 16.
By default, the badge uses:
<div t-field="employee.barcode" t-options="{'widget': 'barcode'}"/>
My goal is to print a QR code instead of a standard bar-code.
Right now, the solution that works is to replace the widget using a QWeb inherited view:
<xpath expr="//div[@t-field='employee.barcode']" position="replace"> <t t-if="employee.barcode"> <img t-att-src="'/report/barcode/QR/%s' % employee.barcode" style="width:80pt; height:80pt;" alt="Employee QR"/> </t> </xpath>
This works correctly, but since I’m using <img> calling
/report/barcode/QR/<value>, I’d like to know:
Is there a native way to make widget="barcode" generate a QR code?
(I tried type: 'QR' inside t-options with no luck.)
Is the /report/barcode/QR/... method the officially recommended way?
Is there an OCA module or an Odoo-supported mechanism for switching barcode formats in reports?
Any cleaner or more future-proof approach recommended?
Or should I just generate the QR codes outside Odoo (lol)?
Thanks in advance!