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

Hello,

I'm customizing the sales module in order to generate a specific product variant (product.product) from a product.template.

Seems is all working properly until I invoke the product.product.create method:


...

used_variant = env['product.product'].create({

​'product_tmpl_id': product_template.id,

​'product_template_variant_value_ids': [(6, 0, attribute_values)]

})

...


Here I receive an error regarding my attribute_values array. Here below how I populate the array:

attribute_values = [

​latime_attr_value.id,

​inaltime_attr_value.id

]


And my ​latime_attr_value and ​inaltime_attr_value are product.attribute.value type objects.

Any idea on how to format in the proper way the variable attribute_values inside the peroduct.product creation method??




อวตาร
ละทิ้ง

What kind of error, can you post full error log

คำตอบที่ดีที่สุด

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Maximum number of variants แก้ไขแล้ว
1
มี.ค. 25
4508
1
ก.ค. 24
1715
0
ต.ค. 22
2869
0
มี.ค. 25
1323
0
มิ.ย. 24
1071