Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
8758 Weergaven

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
Annuleer
Beste antwoord

(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
Annuleer
Auteur

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

Beste antwoord

I found it out, Great!!

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
nov. 19
3927
1
jul. 23
2361
0
mei 23
2206
3
mrt. 25
23490
3
mrt. 23
10774