From 5b08b4caf4ba71c3bb388cb26faef292bfd90a10 Mon Sep 17 00:00:00 2001 From: Jos De Graeve Date: Wed, 14 Jun 2017 11:44:54 +0200 Subject: [PATCH] allow to avoid 'Recall last saved values' command This command causes Godex printers in GZPL emulation not to print the label, this might be a firmware bug (tested on G500 Z1.00E ) --- printer_zpl2/models/printing_label_zpl2.py | 7 ++++++- printer_zpl2/views/printing_label_zpl2.xml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/printer_zpl2/models/printing_label_zpl2.py b/printer_zpl2/models/printing_label_zpl2.py index 76aa220..760c72f 100644 --- a/printer_zpl2/models/printing_label_zpl2.py +++ b/printer_zpl2/models/printing_label_zpl2.py @@ -39,6 +39,10 @@ class PrintingLabelZpl2(models.Model): comodel_name='printing.label.zpl2.component', inverse_name='label_id', string='Label Components', help='Components which will be printed on the label.') + restore_saved_config = fields.Boolean( + string="Restore printer's configuration", + help="Restore printer's saved configuration and end of each label ", + default=True) @api.multi def _generate_zpl2_components_data( @@ -167,7 +171,8 @@ class PrintingLabelZpl2(models.Model): page_count=page_count) # Restore printer's configuration and end the label - label_data.configuration_update(zpl2.CONF_RECALL_LAST_SAVED) + if self.restore_saved_config: + label_data.configuration_update(zpl2.CONF_RECALL_LAST_SAVED) label_data.label_end() return label_data.output() diff --git a/printer_zpl2/views/printing_label_zpl2.xml b/printer_zpl2/views/printing_label_zpl2.xml index 24b98aa..2782d8f 100644 --- a/printer_zpl2/views/printing_label_zpl2.xml +++ b/printer_zpl2/views/printing_label_zpl2.xml @@ -26,6 +26,7 @@ +