diff --git a/printer_zpl2/README.rst b/printer_zpl2/README.rst index 3bfb1784239..0b23636a641 100644 --- a/printer_zpl2/README.rst +++ b/printer_zpl2/README.rst @@ -55,6 +55,20 @@ To configure this module, you need to: 3. Import ZPL2 code 4. Use the Test Mode tab during the creation +It's also possible to add a label printing wizard on any model by +creating a new *ir.actions.act_window* record. For example, to add the +printing wizard on the *product.product* model : + +:: + + + Usage ===== @@ -75,7 +89,7 @@ models. |Try me on Runbot| .. |Try me on Runbot| image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :target: https://runbot.odoo-community.org/runbot/144/17.0 + :target: https://runbot.odoo-community.org/runbot/144/12.0 Changelog ========= diff --git a/printer_zpl2/models/printing_label_zpl2.py b/printer_zpl2/models/printing_label_zpl2.py index 66a7a56a93a..aee4b14f64b 100644 --- a/printer_zpl2/models/printing_label_zpl2.py +++ b/printer_zpl2/models/printing_label_zpl2.py @@ -131,14 +131,14 @@ def _get_component_data(self, record, component, eval_args): except Exception as e: raise exceptions.UserError( _( - "The syntax of this componant %s [%s]" - " is wrong.\nRecord : %s.\n" - "Please check the syntax.\n\n%s\n\n%s", - component.display_name, - component.label_id.display_name, - record.display_name, - e, - traceback.format_exc(), + "The syntax of this componant %(display_name)s [%(label_name)s]" + " is wrong.\nRecord : %(record_name)s.\n" + "Please check the syntax.\n\n%(error)s\n\n%(traceback)s", + display_name=component.display_name, + label_name=component.label_id.display_name, + record_name=record.display_name, + error=e, + traceback=traceback.format_exc(), ) ) from e @@ -528,7 +528,7 @@ def _generate_labelary_image(self): height = round(self.labelary_height / 25.4, 2) url = url.format(dpmm=self.labelary_dpmm, width=width, height=height) extra = safe_eval(self.extra, {"env": self.env}) - extra['labelary_emul'] = True + extra["labelary_emul"] = True zpl_file = self._generate_zpl2_data(record, extra=extra) files = {"file": zpl_file} headers = {"Accept": "image/png"} diff --git a/printer_zpl2/static/description/index.html b/printer_zpl2/static/description/index.html index c01084ba26c..0a0acf3cef7 100644 --- a/printer_zpl2/static/description/index.html +++ b/printer_zpl2/static/description/index.html @@ -1,4 +1,3 @@ -