İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
1979 Görünümler

please check my code below, i want to conatenate 2 fields o.name & o.ref to generate barcode in qweb pdf, how i can do it, please help.


   
   
   
   


        Barcode
   


   

   

   



regards


NOTE: Its my Horrible mistake i used slash to use html code once here to post my code but its not visible for me at least now. please remove this FEATURE so people don't be disturb when use it. i can't delete my post and when i removed all text using ctrl-a and copying from notepad but still it is showing as same... the code portion is annoying here. i am very sorry but it is second time i am in frustration because of using this FEATURE. hope someone once will guide us or give us a link to the guide ACTUALLY how to post. thanks

Avatar
Vazgeç
En İyi Yanıt

Hi,

To concatenate two fields, you can use + operator in template.

Eg: 

<t t-foreach="partners or []" t-as="partner">
<option t-att-value="partner.id">
<t t-esc="partner.name"/>
                   <t t-if="partner.last_name"
                             t-esc="' ' + partner.last_name"/>
        </option>
</t>



The above code is to see the partner name and last name separated by a blank space in the template. As you might have noticed, the partner doesn't have a last_name field. So, in order to concatenate them, the above method was used.

Avatar
Vazgeç
Üretici

i have used code as below:
img t-att-src="'/report/barcode/Code128/'+o.name + o.ref" style="width:200px;height:50px" alt="Barcode"

its not working using + operator in between o.name + o.ref
please help.

İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Nis 24
2445
0
Kas 23
2108
1
Ağu 23
5338
1
Haz 23
4000
0
Nis 23
103