Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
3072 Näkymät

I spent hours doing this and don't want to do it again.

Avatar
Hylkää
Paras vastaus

Create a Server Action like this:


for record in records:
product_template = env['product.template'].search([('id','=',record.res_id)])
for variant in product_template.product_variant_ids:
new_attachment = record.copy()
new_attachment['res_id'] = variant.id
new_attachment['res_model'] = 'product.product'


And make sure to click CREATE CONTEXTUAL ACTION so you can select the relevant attachments and have them copied from the product.template to the product.variant:


Then you can re-select all the attachments and DELETE them (if applicable).

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
marrask. 23
1169
3
toukok. 25
1466
3
marrask. 24
8218
3
syysk. 24
6043
0
jouluk. 17
3853