Fix problem when cancelling an order with invoices with different prefixes

This commit is contained in:
Raphael Michel
2019-11-13 14:13:31 +01:00
parent 54091b9721
commit b876293453

View File

@@ -289,7 +289,7 @@ def _cancel_order(order, user=None, send_mail: bool=True, api_token=None, device
if not order.cancel_allowed():
raise OrderError(_('You cannot cancel this order.'))
i = order.invoices.filter(is_cancellation=False).last()
i = order.invoices.filter(is_cancellation=False, refered__isnull=True).last()
if i:
generate_cancellation(i)