Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
3108 Visninger

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

Avatar
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
0
nov. 23
1259
3
maj 25
1632
3
nov. 24
8421
3
sep. 24
6196
0
dec. 17
3985