diff --git a/report_qweb_pdf_watermark/README.rst b/report_qweb_pdf_watermark/README.rst index d2afa15346..92e2a54a73 100644 --- a/report_qweb_pdf_watermark/README.rst +++ b/report_qweb_pdf_watermark/README.rst @@ -132,6 +132,7 @@ Contributors * Foram Shah * Emiel van Bokhoven * Anjeel Haria +* Hugo Martínez Maintainers ~~~~~~~~~~~ diff --git a/report_qweb_pdf_watermark/models/report.py b/report_qweb_pdf_watermark/models/report.py index b48516933d..9e178fdbff 100644 --- a/report_qweb_pdf_watermark/models/report.py +++ b/report_qweb_pdf_watermark/models/report.py @@ -62,27 +62,7 @@ def pdf_has_usable_pages(self, numpages): ) return True - @api.model - def _run_wkhtmltopdf( - self, - bodies, - report_ref=False, - header=None, - footer=None, - landscape=False, - specific_paperformat_args=None, - set_viewport_size=False, - ): - result = super(Report, self)._run_wkhtmltopdf( - bodies, - report_ref=report_ref, - header=header, - footer=footer, - landscape=landscape, - specific_paperformat_args=specific_paperformat_args, - set_viewport_size=set_viewport_size, - ) - + def _get_watermark(self, report_ref): docids = self.env.context.get("res_ids", False) report_sudo = self._get_report(report_ref) watermark = None @@ -105,6 +85,30 @@ def _run_wkhtmltopdf( if watermark: watermark = b64decode(watermark) + return watermark + + @api.model + def _run_wkhtmltopdf( + self, + bodies, + report_ref=False, + header=None, + footer=None, + landscape=False, + specific_paperformat_args=None, + set_viewport_size=False, + ): + result = super(Report, self)._run_wkhtmltopdf( + bodies, + report_ref=report_ref, + header=header, + footer=footer, + landscape=landscape, + specific_paperformat_args=specific_paperformat_args, + set_viewport_size=set_viewport_size, + ) + watermark = self._get_watermark(report_ref) + if not watermark: return result diff --git a/report_qweb_pdf_watermark/readme/CONTRIBUTORS.rst b/report_qweb_pdf_watermark/readme/CONTRIBUTORS.rst index cd5afe984e..dfd4a1ea2f 100644 --- a/report_qweb_pdf_watermark/readme/CONTRIBUTORS.rst +++ b/report_qweb_pdf_watermark/readme/CONTRIBUTORS.rst @@ -5,3 +5,4 @@ * Foram Shah * Emiel van Bokhoven * Anjeel Haria +* Hugo Martínez diff --git a/report_qweb_pdf_watermark/static/description/index.html b/report_qweb_pdf_watermark/static/description/index.html index 97a381e8be..2154eda5bb 100644 --- a/report_qweb_pdf_watermark/static/description/index.html +++ b/report_qweb_pdf_watermark/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -489,12 +489,15 @@

Contributors

  • Foram Shah <foram.shah@initos.com>
  • Emiel van Bokhoven <emiel@360erp.nl>
  • Anjeel Haria
  • +
  • Hugo Martínez <hugo.martinez@netkia.es>
  • Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +Odoo Community Association +

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.