Reputation: 14746
I want to show data with specific length in qweb template and more data would be replaced by ...
i.e Name = "Administrator"
and if I want to show only first five char then,
"Admin..."
I have google about this topic but no luck, and no such documentation related to that.
Any help would be appreciated.
Upvotes: 2
Views: 4571
Reputation: 2892
Create a custom function on parser report class
def cal_string(string):
if len(string) >5
val=string[:5]+'...'
else:
val=string
return val
Call the function into Qweb Template
<field t-esc="cal_string(string)" />
I hope my answer may helpful for you :)
Upvotes: 1