Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
3408 Zobrazení

Hi,

I would need to print the SO number f.e SO015 on the Sales Order PDF (Quotation/Order) f.e. as Code128 barcode. 

Is there any module or could please someone explain how this can be done in qweb etc. Thank you

Avatar
Zrušit
Nejlepší odpověď

Hello Simon

Please try with
t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', you field name, 600, 150)"

Thanks & Regards,

 
Email: odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

Avatar
Zrušit
Autor

Hello, did you possibly want to post a module. Unfortunately your answer is not clear to me. Thanks

Autor

Hi Jainesh, Thank you for your help. I had some problems with it but then got it working with:

<img t-att-src="'/report/barcode/Code128/%s' % doc.name"/>

Thanks

Nejlepší odpověď

Hi Simon:

To clarify Jainesh's post, Odoo has a builtin feature that allows you to generate a barcode image and include it in the QWeb report. To do this, you need to include an tag at the desired location in your report xml like so:


<img alt="SO Number" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', doc.name, 600, 150)"/>

The URL /report/barcode/ points to a controller that generates a barcode image based on the values of the parameters passed to it.

Hope this helps.

Avatar
Zrušit
Autor

Hi Paresh, I got it working with some other help. However when using your code I get the following error: EntityRef: expecting ';', line 15, column 89

Any idea?

Hi Simon: Replace the & signs with &amp; so they get treated as HTML entities

Related Posts Odpovědi Zobrazení Aktivita
1
bře 23
1924
0
čvn 23
2546
0
pro 22
2734
0
srp 21
2842
1
čvc 25
1854