跳至内容
菜单
此问题已终结
2 回复
767 查看

I am trying to add QR code in the Invoice pdf. I am not an expert in odoo or python but have a basic knowledge for editing the exiting code.


For adding the QR code in Invoice I have edited the view report_invoice_document under Technical->user Interface->Views and added the following line for generating QR code.



The above code generates a QR Code which has the text upi:/pay

The QRcode is getting generated but the link in QR Code is truncated. 


In case I use upi:/ instead of upi:// as shown below full link is getting generated.



How to get the full link with upi:// ?


形象
丢弃
编写者 最佳答案

  q

形象
丢弃
最佳答案

Try the following code

<img t-att-src=”’/report/barcode/QR/’ + ‘upi:/’ + ‘/’ + ‘pay……..’>


To include // after upi: in an HTML attribute, you need to properly escape the characters so that they are interpreted correctly. In HTML, the colon (:) and slashes (/) have special meanings, so they need to be represented by their corresponding HTML entities.



形象
丢弃
编写者

Now upi:// is coming in the QR code but the ? after pay is creating an issue. the QR code now contains only upi://pay and the string followed by ? is getting dropped.