From f405e4b70194418b4a6e7b264acfd6531ee5c15d Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 7 Aug 2021 22:28:48 +1000 Subject: [PATCH 1/2] Add inline option for reports, too --- InvenTree/label/api.py | 1 + InvenTree/report/api.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/InvenTree/label/api.py b/InvenTree/label/api.py index c8b265fd93..2ee8445d2e 100644 --- a/InvenTree/label/api.py +++ b/InvenTree/label/api.py @@ -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, diff --git a/InvenTree/report/api.py b/InvenTree/report/api.py index f09a52f272..576cb310e5 100644 --- a/InvenTree/report/api.py +++ b/InvenTree/report/api.py @@ -254,6 +254,8 @@ 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, From e583d1a1591bbd31de7595256c00a5dfa43d237b Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 7 Aug 2021 22:30:51 +1000 Subject: [PATCH 2/2] Actually use the variable, I suppose --- InvenTree/report/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/InvenTree/report/api.py b/InvenTree/report/api.py index 576cb310e5..2129b31627 100644 --- a/InvenTree/report/api.py +++ b/InvenTree/report/api.py @@ -259,7 +259,8 @@ class ReportPrintMixin: return InvenTree.helpers.DownloadFile( pdf, report_name, - content_type='application/pdf' + content_type='application/pdf', + inline=inline, )