跳至内容
菜单
此问题已终结
2 回复
8782 查看

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 ?

形象
丢弃
最佳答案

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



形象
丢弃
编写者

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

最佳答案

I found it out, Great!!

形象
丢弃
相关帖文 回复 查看 活动
1
11月 19
3940
1
7月 23
2376
0
5月 23
2210
3
3月 25
23549
3
3月 23
10787