Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
3057 Представления

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

Аватар
Отменить
Лучший ответ

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
нояб. 23
1153
3
мая 25
1417
3
нояб. 24
8152
3
сент. 24
6010
0
дек. 17
3822