Odoo Help

0
0
Emipro
On 11/26/15, 12:28 AM

Hi Vadivel,

It is simple because string is allowed subscripting ([ ]) in python. So, according to that your requirement will be fulfill as like below.

As your field named "desc" will take 50 characters and you want print only 20 in report. Just make this line inside your report, requirement will fulfill.

1) object.desc[0:20] #It will only takes 20 character from desc field.
2) object.desc if len(object.desc) < 20 else "%s..." %(object.desc[0:18])

I hope you will get what you want.

Thanks.

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/25/15, 11:36 PM
Seen: 1956 times
Last updated: 11/26/15, 12:28 AM