Skip to Content
Menu
This question has been flagged
1 Reply
2457 Views

Hello,


I am using Odoo CE V11, I need to separate product name in Qweb.

I have a name as: 1,2,3,4 

I need to get in one line

part1

and i have done with

span t-set="my_name" t-value="o.product_id.name.split(',')" style="font-size:10px"/>

                          <span t-esc="my_name[0]" style="font-weight: bold;"/>


but now I need in another line get 2,3,4

I tried with 

pan t-set="my_name" t-value="o.product_id.name.split(',')" style="font-size:10px"/>

                          <span t-esc="my_name[1]" style="font-weight: bold;"/>

but i get only 2 and not 2,3,4.


How ca I do it?


Regards

Thank you

Avatar
Discard
Best Answer

you can use the join python method

https://www.w3schools.com/python/ref_string_join.asp

I would try something like this: ",".join(o.product_id.name.split(',')[1:])

Avatar
Discard