Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
977 Vistas

Hi all 


What am i missing ?

 t-foreach="product.product_tag_ids" t-as="i"

 t-esc="i" t-options="{'widget': 'many2many_tags'}"



im trying to display tags on a label but the result im getting is 

product.tag(1,) 

product.tag(3,) 

product.tag(5,)


Thanks 

Avatar
Descartar
Mejor respuesta

Hello Steven, 

Try this 

 t-esc="i.name" t-options="{'widget': 'many2many_tags'}"


Avatar
Descartar
Autor

Amazing thanks. Does the .name work with other objects that throw id numbers. would this work with attribute ids?

Welcome, First you need to know why it's working with .name.
Reason: In the case of the "product. tag" model. Where the name field was available and where the tag name was saved.
For other tables, you need to check.

Mostly odoo default tables have a name field.

Autor

Would you be able to help me get the full value of the current products attributes

I'm trying to get the product label to say

Length: 3000mm

Where 3000 is the value in the drop-down for length. I can't seem to find the right combination that doesn't throw a id number where name works