Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
8755 Lượt xem

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 ?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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



Ảnh đại diện
Huỷ bỏ
Tác giả

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

Câu trả lời hay nhất

I found it out, Great!!

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 19
3911
1
thg 7 23
2358
0
thg 5 23
2202
3
thg 3 25
23474
3
thg 3 23
10770