Hello,
I have a customer who has long product names in his database so in the invoice reports i want to create new line after each 30 characters, so i will be thankful to anyone who can tell me how to do that.
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
I have a customer who has long product names in his database so in the invoice reports i want to create new line after each 30 characters, so i will be thankful to anyone who can tell me how to do that.
Thanks
Hello Ali Mahmoud,
You can replace the below code on behalf of the Product name field in the table.
<t t-set="productname" t-value="line.name"/>
<t t-if="len(productname) > 30">
<t t-foreach="range(0, len(productname)+1, 30)" t-as="product">
<span t-esc="productname[product:product+30]"/><br></br>
</t>
</t>
<t t-else="">
<span t-esc="productname"/>
</t>
Thanks it works, but how can I avoid splitting the words? I mean to make the new line before the word starts
To avoid word splitting it's a little difficult, for that you can call python function and build logic from there.
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 7 25
|
2147 | ||
|
1
thg 5 25
|
2406 | ||
|
1
thg 4 25
|
2603 | ||
|
1
thg 2 25
|
1904 | ||
|
2
thg 2 25
|
4679 |