Copy ItemVariation.limit_sales_channels when copying items

This commit is contained in:
Raphael Michel
2025-01-15 15:46:25 +01:00
parent 3ce6030122
commit 3b4b91c81f
2 changed files with 11 additions and 2 deletions
+2
View File
@@ -539,6 +539,8 @@ class ItemCreateForm(I18nModelForm):
v.pk = None
v.item = instance
v.save()
if not variation.all_sales_channels:
v.limit_sales_channels.set(variation.limit_sales_channels.all())
for mv in variation.meta_values.all():
mv.pk = None
mv.variation = v