Bank transfer: Hide email form if email was already sent (Z#23128941) (#3570)

Co-authored-by: Mira <weller@rami.io>
This commit is contained in:
Raphael Michel
2023-09-08 14:11:45 +02:00
committed by GitHub
parent b04ec720dc
commit 8dbc7ac5d7
3 changed files with 21 additions and 1 deletions

View File

@@ -923,5 +923,11 @@ class SendInvoiceMailView(EventViewMixin, OrderDetailMixin, View):
provider = last_payment.payment_provider
provider.send_invoice_to_alternate_email(self.order, last_invoice, request.POST['email'])
last_payment.info_data = {
**last_payment.info_data,
'send_invoice_to': request.POST['email'],
}
last_payment.save(update_fields=['info'])
messages.success(request, _('Sending the latest invoice via e-mail to {email}.').format(email=request.POST['email']))
return redirect(self.get_order_url())