From a8d72c191844b1b81b1598e02b4633bc782e47f0 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Tue, 12 Mar 2019 13:50:51 +0100 Subject: [PATCH] [FIX] printer_zpl2: QR as bytes --- printer_zpl2/models/printing_label_zpl2.py | 2 +- printer_zpl2/tests/test_printing_label_zpl2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/printer_zpl2/models/printing_label_zpl2.py b/printer_zpl2/models/printing_label_zpl2.py index 273c482..e3de9d2 100644 --- a/printer_zpl2/models/printing_label_zpl2.py +++ b/printer_zpl2/models/printing_label_zpl2.py @@ -199,7 +199,7 @@ class PrintingLabelZpl2(models.Model): else: if component.component_type == zpl2.BARCODE_QR_CODE: # Adding Control Arguments to QRCode data Label - data = 'MM,A{}'.format(data) + data = '{}A,{}'.format(component.error_correction, data) barcode_arguments = dict([ (field_name, component[field_name]) diff --git a/printer_zpl2/tests/test_printing_label_zpl2.py b/printer_zpl2/tests/test_printing_label_zpl2.py index f330cd2..b944696 100644 --- a/printer_zpl2/tests/test_printing_label_zpl2.py +++ b/printer_zpl2/tests/test_printing_label_zpl2.py @@ -1002,7 +1002,7 @@ class TestPrintingLabelZpl2(TransactionCase): # Component format '^BQN,2,1,Q,7' # Component contents - '^FDMM,A{contents}' + '^FDQA,{contents}' # Component end '^FS\n' # Recall last saved parameters