Merge pull request #1921 from SchrodingersGat/label-print-options

Add inline option for reports, too
This commit is contained in:
Oliver 2021-08-07 22:49:55 +10:00 committed by GitHub
commit 0d80ae9f93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -110,6 +110,7 @@ class LabelPrintMixin:
pdf = outputs[0].get_document().write_pdf()
inline = common.models.InvenTreeUserSetting.get_setting('LABEL_INLINE', user=request.user)
return InvenTree.helpers.DownloadFile(
pdf,
label_name,

View File

@ -254,10 +254,13 @@ class ReportPrintMixin:
else:
pdf = outputs[0].get_document().write_pdf()
inline = common.models.InvenTreeUserSetting.get_setting('REPORT_INLINE', user=request.user)
return InvenTree.helpers.DownloadFile(
pdf,
report_name,
content_type='application/pdf'
content_type='application/pdf',
inline=inline,
)