begin to fix bill view

This commit is contained in:
Nico Schottelius 2020-06-21 23:54:57 +02:00
commit 662e706eab
2 changed files with 6 additions and 12 deletions

View file

@ -47,7 +47,9 @@ class BillAdmin(admin.ModelAdmin):
raise self._get_404_exception(object_id)
output_file = NamedTemporaryFile()
bill_html = render_to_string("bill.html.j2", {'bill': bill})
bill_html = render_to_string("bill.html.j2", {'bill': bill,
'bill_records': bill.bill_records.all()
})
bytestring_to_pdf(bill_html.encode('utf-8'), output_file)
response = FileResponse(output_file, content_type="application/pdf")