Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
1306 Visualizzazioni

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
Abbandona

What kind of error, can you post full error log

Risposta migliore

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
mar 25
4520
1
lug 24
1724
0
ott 22
2884
0
mar 25
1332
0
giu 24
1086