Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3046 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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).

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
lis 23
1150
3
maj 25
1396
3
lis 24
8138
3
wrz 24
6003
0
gru 17
3810