Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
1984 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur

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.

Publications associées Réponses Vues Activité
0
avr. 24
2446
0
nov. 23
2108
1
août 23
5339
1
juin 23
4003
0
avr. 23
103