mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 04:26:44 +00:00
Fix LabelPrintingMixin label_instance contains now specific data (#3394)
This commit is contained in:
parent
eecb26676e
commit
61ac02a045
@ -95,6 +95,7 @@ class LabelPrintMixin:
|
|||||||
label_name = "label.pdf"
|
label_name = "label.pdf"
|
||||||
|
|
||||||
label_names = []
|
label_names = []
|
||||||
|
label_instances = []
|
||||||
|
|
||||||
# Merge one or more PDF files into a single download
|
# Merge one or more PDF files into a single download
|
||||||
for item in items_to_print:
|
for item in items_to_print:
|
||||||
@ -104,6 +105,7 @@ class LabelPrintMixin:
|
|||||||
label_name = label.generate_filename(request)
|
label_name = label.generate_filename(request)
|
||||||
|
|
||||||
label_names.append(label_name)
|
label_names.append(label_name)
|
||||||
|
label_instances.append(label)
|
||||||
|
|
||||||
if debug_mode:
|
if debug_mode:
|
||||||
outputs.append(label.render_as_string(request))
|
outputs.append(label.render_as_string(request))
|
||||||
@ -123,9 +125,6 @@ class LabelPrintMixin:
|
|||||||
- Return a JSON response indicating that the printing has been offloaded
|
- Return a JSON response indicating that the printing has been offloaded
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Label instance
|
|
||||||
label_instance = self.get_object()
|
|
||||||
|
|
||||||
for idx, output in enumerate(outputs):
|
for idx, output in enumerate(outputs):
|
||||||
"""For each output, we generate a temporary image file, which will then get sent to the printer."""
|
"""For each output, we generate a temporary image file, which will then get sent to the printer."""
|
||||||
|
|
||||||
@ -138,7 +137,7 @@ class LabelPrintMixin:
|
|||||||
plugin.plugin_slug(),
|
plugin.plugin_slug(),
|
||||||
pdf,
|
pdf,
|
||||||
filename=label_names[idx],
|
filename=label_names[idx],
|
||||||
label_instance=label_instance,
|
label_instance=label_instances[idx],
|
||||||
user=request.user,
|
user=request.user,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user