Order data export: Include ID of parent position of add-ons

This commit is contained in:
Raphael Michel
2024-07-23 15:52:55 +02:00
parent bb9b9ac9aa
commit 19f3fbc7e8
+5 -2
View File
@@ -560,7 +560,7 @@ class OrderListExporter(MultiSheetListExporter):
), ),
).select_related( ).select_related(
'order', 'order__invoice_address', 'order__customer', 'item', 'variation', 'order', 'order__invoice_address', 'order__customer', 'item', 'variation',
'voucher', 'tax_rule' 'voucher', 'tax_rule', 'addon_to',
).prefetch_related( ).prefetch_related(
'subevent', 'subevent__meta_values', 'subevent', 'subevent__meta_values',
'answers', 'answers__question', 'answers__options' 'answers', 'answers__question', 'answers__options'
@@ -619,6 +619,7 @@ class OrderListExporter(MultiSheetListExporter):
_('Valid until'), _('Valid until'),
_('Order comment'), _('Order comment'),
_('Follow-up date'), _('Follow-up date'),
_('Add-on to position ID'),
] ]
questions = list(Question.objects.filter(event__in=self.events)) questions = list(Question.objects.filter(event__in=self.events))
@@ -652,7 +653,8 @@ class OrderListExporter(MultiSheetListExporter):
_('VAT ID'), _('VAT ID'),
] ]
headers += [ headers += [
_('Sales channel'), _('Order locale'), _('Sales channel'),
_('Order locale'),
_('E-mail address verified'), _('E-mail address verified'),
_('External customer ID'), _('External customer ID'),
_('Check-in lists'), _('Check-in lists'),
@@ -743,6 +745,7 @@ class OrderListExporter(MultiSheetListExporter):
] ]
row.append(order.comment) row.append(order.comment)
row.append(order.custom_followup_at.strftime("%Y-%m-%d") if order.custom_followup_at else "") row.append(order.custom_followup_at.strftime("%Y-%m-%d") if order.custom_followup_at else "")
row.append(op.addon_to.positionid if op.addon_to_id else "")
acache = {} acache = {}
for a in op.answers.all(): for a in op.answers.all():
# We do not want to localize Date, Time and Datetime question answers, as those can lead # We do not want to localize Date, Time and Datetime question answers, as those can lead