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

@@ -203,7 +203,7 @@ def build_cancellation(invoice: Invoice):
def generate_cancellation(invoice: Invoice, trigger_pdf=True):
if invoice.refered.exists():
if invoice.canceled:
raise ValueError("Invoice should not be canceled twice.")
cancellation = modelcopy(invoice)
cancellation.pk = None