switch to using a filefield to save the invoice pdf
This commit is contained in:
parent
475f996a02
commit
2fdfacc4d7
|
@ -43,8 +43,8 @@ class Command(BaseCommand):
|
||||||
self.stdout.write('ERROR: Unable to generate PDF file for invoice #%s' % invoice.pk)
|
self.stdout.write('ERROR: Unable to generate PDF file for invoice #%s' % invoice.pk)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# update invoice object
|
# update invoice object with the file
|
||||||
invoice.pdf_generated=True
|
invoice.pdf.save(invoice.filename, File(pdffile))
|
||||||
invoice.save()
|
invoice.save()
|
||||||
|
|
||||||
### check if we need to send out any invoices
|
### check if we need to send out any invoices
|
||||||
|
|
|
@ -255,7 +255,7 @@ class EpayPayment(CreatedUpdatedModel, UUIDModel):
|
||||||
|
|
||||||
class Invoice(CreatedUpdatedModel):
|
class Invoice(CreatedUpdatedModel):
|
||||||
order = models.OneToOneField('shop.Order')
|
order = models.OneToOneField('shop.Order')
|
||||||
pdf_generated = models.BooleanField(default=False)
|
pdf = models.FileField(null=True, blank=True)
|
||||||
sent_to_customer = models.BooleanField(default=False)
|
sent_to_customer = models.BooleanField(default=False)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
Loading…
Reference in a new issue