New implementation of sales channels (#4111)

Co-authored-by: Martin Gross <gross@rami.io>
This commit is contained in:
Raphael Michel
2024-06-30 19:24:30 +02:00
committed by GitHub
parent 95511b0330
commit 4fb5c6bef0
174 changed files with 2902 additions and 616 deletions

View File

@@ -47,7 +47,7 @@ class TicketLayoutItemForm(forms.ModelForm):
super().__init__(*args, **kwargs)
if self.sales_channel.identifier != 'web':
self.fields['layout'].label = _('PDF ticket layout for {channel}').format(
channel=self.sales_channel.verbose_name
channel=self.sales_channel.label
)
self.fields['layout'].empty_label = _('(Same as PDF ticket layout)')
else:
@@ -57,7 +57,7 @@ class TicketLayoutItemForm(forms.ModelForm):
self.fields['layout'].required = False
def save(self, commit=True):
self.instance.sales_channel = self.sales_channel.identifier
self.instance.sales_channel = self.sales_channel
if self.cleaned_data['layout'] is None:
if self.instance.pk:
self.instance.delete()