diff --git a/base_report_to_printer/README.rst b/base_report_to_printer/README.rst index 0fcacffb1f3..f4054d23606 100644 --- a/base_report_to_printer/README.rst +++ b/base_report_to_printer/README.rst @@ -77,6 +77,14 @@ To configure this module, you need to: #. Enable the "Printing / Print User" option under access rights to give users the ability to view the print menu. + +The jobs will be sent to the printer with a name matching the print_report_name +of the report (truncated at 80 characters). By default this will not be +displayed by CUPS web interface or in Odoo. To see this information, you need +to change the configuration of your CUPS server and set the JobPrivateValue +directive to "job-name", and reload the server. See `cupsd.conf(5) +` for details. + Usage ===== @@ -145,6 +153,7 @@ Contributors * Jairo Llopis * Graeme Gellatly * Rod Schouteden +* Alexandre Fayolle Maintainers ~~~~~~~~~~~ diff --git a/base_report_to_printer/models/printing_server.py b/base_report_to_printer/models/printing_server.py index 6ae2c6c14f3..ad1ef8c2827 100644 --- a/base_report_to_printer/models/printing_server.py +++ b/base_report_to_printer/models/printing_server.py @@ -36,6 +36,13 @@ def _open_connection(self, raise_on_error=False): self.ensure_one() connection = False try: + # Sometimes connecting to printer servers outside of the local network + # can result in a weird error "cups.IPPError: (1030, 'The printer + # or class does not exist.')". + # An explicit call to `setServer` and `setPort` fixed the issue. + # (see https://github.com/OpenPrinting/pycups/issues/30) + cups.setServer(self.address) + cups.setPort(self.port) connection = cups.Connection(host=self.address, port=self.port) except Exception: message = _( diff --git a/base_report_to_printer/static/description/index.html b/base_report_to_printer/static/description/index.html index 8f77133544c..0c79daa9353 100644 --- a/base_report_to_printer/static/description/index.html +++ b/base_report_to_printer/static/description/index.html @@ -428,6 +428,12 @@

Configuration

  • Enable the “Printing / Print User” option under access rights to give users the ability to view the print menu.
  • +

    The jobs will be sent to the printer with a name matching the print_report_name +of the report (truncated at 80 characters). By default this will not be +displayed by CUPS web interface or in Odoo. To see this information, you need +to change the configuration of your CUPS server and set the JobPrivateValue +directive to “job-name”, and reload the server. See cupsd.conf(5) +<https://www.cups.org/doc/man-cupsd.conf.html> for details.

    Usage

    @@ -498,6 +504,7 @@

    Contributors

  • Jairo Llopis <jairo.llopis@tecnativa.com>
  • Graeme Gellatly <graeme@o4sb.com>
  • Rod Schouteden <rod@schout-it.be>
  • +
  • Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
  • diff --git a/base_report_to_printer/views/printing_printer.xml b/base_report_to_printer/views/printing_printer.xml index 27e52107a49..379aedd0cbe 100644 --- a/base_report_to_printer/views/printing_printer.xml +++ b/base_report_to_printer/views/printing_printer.xml @@ -47,6 +47,7 @@
    + @@ -100,6 +101,7 @@ +