forked from CGM_Public/pretix_original
Fix #2192 -- Invoice address name-field always gets overwritten with customer profile
This commit is contained in:
@@ -976,7 +976,7 @@ class BaseInvoiceAddressForm(forms.ModelForm):
|
||||
scheme=event.settings.name_scheme,
|
||||
titles=event.settings.name_scheme_titles,
|
||||
label=_('Name'),
|
||||
initial=(self.instance.name_parts if self.instance else self.instance.name_parts),
|
||||
initial=self.instance.name_parts,
|
||||
)
|
||||
if event.settings.invoice_address_required and not event.settings.invoice_address_company_required and not self.all_optional:
|
||||
if not event.settings.invoice_name_required:
|
||||
|
||||
@@ -768,7 +768,7 @@ class QuestionsStep(QuestionsViewMixin, CartMixin, TemplateFlowStep):
|
||||
wd_initial = {}
|
||||
initial = dict(wd_initial)
|
||||
|
||||
if self.cart_customer:
|
||||
if self.cart_customer and not self.invoice_address.pk:
|
||||
initial.update({
|
||||
'name_parts': self.cart_customer.name_parts
|
||||
})
|
||||
@@ -779,7 +779,8 @@ class QuestionsStep(QuestionsViewMixin, CartMixin, TemplateFlowStep):
|
||||
override_sets = self._contact_override_sets
|
||||
for overrides in override_sets:
|
||||
initial.update({
|
||||
k: v['initial'] for k, v in overrides.items() if 'initial' in v
|
||||
k: v['initial'] for k, v in overrides.items()
|
||||
if 'initial' in v and (v['disabled'] or not self.invoice_address.pk)
|
||||
})
|
||||
|
||||
if not self.address_asked and self.request.event.settings.invoice_name_required:
|
||||
|
||||
Reference in New Issue
Block a user