2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Fix weasyprint version (#3539)

* Pin weasyprint version

- Revert to 54.3
- Fixes https://github.com/inventree/InvenTree/issues/3528

* Simplify label printing for multiple pages

* Simplify PDF generation for multiple report outputs

* Add content wrapper div for base label template

- Allows more extensibility
This commit is contained in:
Oliver
2022-08-15 11:27:27 +10:00
committed by GitHub
parent 00dbf00eb9
commit 87e7112326
5 changed files with 29 additions and 24 deletions

View File

@ -233,17 +233,12 @@ class ReportPrintMixin:
pages = []
try:
for output in outputs:
doc = output.get_document()
for page in doc.pages:
pages.append(page)
if len(outputs) > 1:
# If more than one output is generated, merge them into a single file
for output in outputs:
doc = output.get_document()
for page in doc.pages:
pages.append(page)
pdf = outputs[0].get_document().copy(pages).write_pdf()
else:
pdf = outputs[0].get_document().write_pdf()
pdf = outputs[0].get_document().copy(pages).write_pdf()
except TemplateDoesNotExist as e: