跳至內容
選單
此問題已被標幟
1 回覆
1257 瀏覽次數

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

相關帖文 回覆 瀏覽次數 活動
1
3月 25
4496
1
7月 24
1695
0
10月 22
2849
0
3月 25
1317
0
6月 24
1051