Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
8871 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ย. 19
4028
1
ก.ค. 25
2489
0
พ.ค. 23
2268
3
มี.ค. 25
23809
3
มี.ค. 23
10893