0
votes

I tried to print the bar code/QR code on pos receipt. But it does not work?

<t t-jquery='.pos-center-align' t-operation='after'>
    <div class="pos-center-align barcode">
      <barcode encoding="CODE39">*123456798*</barcode>// It print *123456798*
      <img t-att-src="'/report/barcode/QR/%s' % (order.name)"/>
      <img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s'%('QR', 'text', 200, 200)"/>
    </div>
  </t>

How can I do it?

Output:

1

1 Answers

0
votes

Try with EAN13 type barcode because this is working in my case. Also I have fetched value from "Receipt Ref" which you can find from backend view : Point of Sale >> Orders >> Extra Info In xml you need to write like this :

XML file:

<img t-if="o.pos_reference" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s&amp;humanreadable=%s' % ('Code128', o.pos_reference.split(' ')[1], 600, 100, 1)" style="width:300px;height:50px"/></div>

By this way I can able to print barcode in receipt. Might be this will be helpful to you.