Skip to Content
Menú
This question has been flagged
2 Respostes
8765 Vistes

i can get Attribute value like White,Red,Blue ....

with 

<strong><span t-esc="', '.join(map(lambda x: x.name, product.product_template_attribute_value_ids))"/></strong>

i also need 

Color, Size  attribute name ....
how i can in odoo v13 ?

Avatar
Descartar
Best Answer

(Pdb) self.product_template_attribute_value_ids
product.template.attribute.value(9, 17, 12)
(Pdb) self.product_template_attribute_value_ids.mapped('name')
['M', 'Rainbow', 'Men']
(Pdb) self.product_template_attribute_value_ids.mapped('attribute_id')
product.attribute(4, 2, 5)
(Pdb) self.product_template_attribute_value_ids.mapped('attribute_id.name')
['Size', 'Color', 'Gender']
(Pdb)

so answer is

<strong><span t-esc="', '.join(prodcut.product_template_attribute_value_ids.mapped('attribute_id.name'))"/></strong>



Avatar
Descartar
Autor

this one is what i want ... :) thanks Ravi

Best Answer

I found it out, Great!!

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de nov. 19
3929
1
de jul. 23
2362
0
de maig 23
2207
3
de març 25
23505
3
de març 23
10779