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)
|
||||
continue
|
||||
|
||||
# update invoice object
|
||||
invoice.pdf_generated=True
|
||||
# update invoice object with the file
|
||||
invoice.pdf.save(invoice.filename, File(pdffile))
|
||||
invoice.save()
|
||||
|
||||
### check if we need to send out any invoices
|
||||
|
|
|
@ -255,7 +255,7 @@ class EpayPayment(CreatedUpdatedModel, UUIDModel):
|
|||
|
||||
class Invoice(CreatedUpdatedModel):
|
||||
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)
|
||||
|
||||
def __str__(self):
|
||||
|
|
Loading…
Reference in a new issue