Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
1296 Weergaven

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




Avatar
Annuleer

What kind of error, can you post full error log

Beste antwoord

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
mrt. 25
4513
1
jul. 24
1716
0
okt. 22
2872
0
mrt. 25
1328
0
jun. 24
1077