Skip to content

Commit

Permalink
Fix precommit error
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcLSubteno committed Aug 8, 2024
1 parent 82895bf commit 3986218
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
16 changes: 15 additions & 1 deletion printer_zpl2/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 :

::

<act_window id="action_wizard_purchase"
name="Print Label"
src_model="product.product"
res_model="wizard.print.record.label"
view_mode="form"
target="new"
key2="client_action_multi"/>

Usage
=====

Expand All @@ -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
=========
Expand Down
18 changes: 9 additions & 9 deletions printer_zpl2/models/printing_label_zpl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"}
Expand Down
1 change: 0 additions & 1 deletion printer_zpl2/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand Down

0 comments on commit 3986218

Please sign in to comment.