mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Include "Cross-selling condition products" option when cloning category (#4534)
* Include "Cross-selling condition products" option when cloning category * Add test case * Remove print
This commit is contained in:
@@ -302,6 +302,8 @@ class CategoryCreate(EventPermissionRequiredMixin, CreateView):
|
||||
i = modelcopy(self.copy_from)
|
||||
i.pk = None
|
||||
kwargs['instance'] = i
|
||||
kwargs.setdefault('initial', {})
|
||||
kwargs['initial']['cross_selling_match_products'] = [str(i.pk) for i in self.copy_from.cross_selling_match_products.all()]
|
||||
else:
|
||||
kwargs['instance'] = ItemCategory(event=self.request.event)
|
||||
return kwargs
|
||||
|
||||
Reference in New Issue
Block a user