コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
8869 ビュー

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
4026
1
7月 25
2489
0
5月 23
2267
3
3月 25
23805
3
3月 23
10891