diff --git a/base_report_to_printer/README.rst b/base_report_to_printer/README.rst index 1613e83..526f4d4 100644 --- a/base_report_to_printer/README.rst +++ b/base_report_to_printer/README.rst @@ -111,6 +111,13 @@ Guidelines for use: When no tray is configured for a report and a user, the default tray setup on the CUPS server is used. +Known issues / Roadmap +====================== + +- With threaded printing there's no download fallback when the issue + isn't detected by the CUPS Odoo backend. To able to do it, we would + need to notify the bus or use web_notify for it. + Changelog ========= diff --git a/base_report_to_printer/models/ir_actions_report.py b/base_report_to_printer/models/ir_actions_report.py index 395837f..8af5143 100644 --- a/base_report_to_printer/models/ir_actions_report.py +++ b/base_report_to_printer/models/ir_actions_report.py @@ -59,6 +59,8 @@ class IrActionsReport(models.Model): "skip_printer_exception" ): serializable_result["printer_exception"] = True + if self.env.context.get("force_print_to_client"): + serializable_result["action"] = "client" return serializable_result def _get_user_default_print_behaviour(self): @@ -135,7 +137,10 @@ class IrActionsReport(models.Model): return True else: - return self.print_document(record_ids, data=data) + try: + return self.print_document(record_ids, data=data) + except Exception: + return def print_document_threaded(self, report_id, record_ids, data): with registry(self._cr.dbname).cursor() as cr: @@ -171,6 +176,7 @@ class IrActionsReport(models.Model): else: title = self.report_name behaviour["title"] = title + behaviour["res_ids"] = record_ids # TODO should we use doc_format instead of report_type return printer.print_document( self, document, doc_format=self.report_type, **behaviour diff --git a/base_report_to_printer/readme/ROADMAP.md b/base_report_to_printer/readme/ROADMAP.md new file mode 100644 index 0000000..f35d11c --- /dev/null +++ b/base_report_to_printer/readme/ROADMAP.md @@ -0,0 +1,3 @@ +- With threaded printing there's no download fallback when the issue + isn't detected by the CUPS Odoo backend. To able to do it, we would + need to notify the bus or use web_notify for it. diff --git a/base_report_to_printer/static/description/index.html b/base_report_to_printer/static/description/index.html index 5b5360f..7732f22 100644 --- a/base_report_to_printer/static/description/index.html +++ b/base_report_to_printer/static/description/index.html @@ -399,16 +399,17 @@ preprinted paper such as payment slip.

  • Installation
  • Configuration
  • Usage
  • -
  • Changelog