Hi,
priority
The product name is too long. I want to print the first 10 characters in the output. What is HTML Qweb code?
Thanks.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilitat
- Inventari
- PoS
- Project
- MRP
This question has been flagged
Hello this is Gulshan Negi
Well, you can do this by using the code below.
< span t-field = "product.name" t-options = '{"widget": "text", "options": {"widget": "text", "truncate": 10}}' / >
I hope it will work.
Thank you
Hi,
You can limit the length of characters of field from python using size attribute.
For that, inherit product.template model and override the name field and give attribute size=10
class ProductTemplate(models.Model):
_inherit = "product.template"
name = fields.Char('Name', index='trigram', required=True, translate=True, size=10)
Regards
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-seRelated Posts | Respostes | Vistes | Activitat | |
---|---|---|---|---|
|
3
d’abr. 18
|
4524 | ||
|
0
de juny 25
|
332 | ||
|
1
d’ag. 17
|
5705 | ||
|
0
d’ag. 15
|
7023 | ||
|
1
de març 15
|
5062 |