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

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

形象
丢弃
最佳答案

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.

形象
丢弃
编写者

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.

相关帖文 回复 查看 活动
0
4月 24
2305
0
11月 23
1910
1
8月 23
5081
1
6月 23
3814
0
4月 23
103