Reduce string length in qweb odoo

Viewed 5215

How reduce string length in qweb?

Example:

<p t-field="doc.name" />

return stackoverflow I want remowe last 8 character and get stack

3 Answers

For "char" came from DB (just this works for me, Odoo V11)

<p><span t-if="doc.name" t-esc="str(doc.name)[:-8]"/></p>
Related