Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
3154 Vistas

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

Avatar
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
nov 23
1331
3
may 25
1819
3
nov 24
8685
3
sept 24
6313
0
dic 17
4087