Fix invoice duplication when importing payments for expired orders

This commit is contained in:
Raphael Michel
2019-11-11 18:57:00 +01:00
parent 54cd38bbaa
commit e3c3154469
2 changed files with 2 additions and 2 deletions

View File

@@ -1753,7 +1753,7 @@ def change_payment_provider(order: Order, payment_provider, amount=None, new_pay
if recreate_invoices:
i = order.invoices.filter(is_cancellation=False).last()
if i and order.total != oldtotal:
if i and order.total != oldtotal and not i.canceled:
generate_cancellation(i)
generate_invoice(order)