Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
8768 Vues

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
Ignorer
Meilleure réponse

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

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

Meilleure réponse

I found it out, Great!!

Avatar
Ignorer
Publications associées Réponses Vues Activité
1
nov. 19
3929
1
juil. 23
2362
0
mai 23
2208
3
mars 25
23514
3
mars 23
10779