Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
3117 Ansichten

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

Avatar
Verwerfen
Beste Antwort

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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Nov. 23
1259
3
Mai 25
1633
3
Nov. 24
8423
3
Sept. 24
6197
0
Dez. 17
3990