Fix incorrect setting if Invoice.full_invoice_no

This commit is contained in:
Raphael Michel
2021-11-04 13:48:39 +01:00
parent 754d4f4f62
commit 19cde63505
2 changed files with 4 additions and 1 deletions

View File

@@ -264,6 +264,7 @@ class Invoice(models.Model):
self.invoice_no = self._get_invoice_number_from_order()
try:
with transaction.atomic():
self.full_invoice_no = self.prefix + self.invoice_no
return super().save(*args, **kwargs)
except DatabaseError:
# Suppress duplicate key errors and try again