diff --git a/base_report_to_printer/README.rst b/base_report_to_printer/README.rst index 9d20b9a5fc4..14b01548809 100644 --- a/base_report_to_printer/README.rst +++ b/base_report_to_printer/README.rst @@ -161,6 +161,11 @@ Contributors * Matias Peralta * Akim Juillerat +* `Tecnativa `_ + + * Sergio Teruel + * David Vidal + Maintainers ~~~~~~~~~~~ diff --git a/base_report_to_printer/__manifest__.py b/base_report_to_printer/__manifest__.py index 37e02ae3550..4132320c690 100644 --- a/base_report_to_printer/__manifest__.py +++ b/base_report_to_printer/__manifest__.py @@ -14,7 +14,7 @@ " Open for Small Business Ltd", "website": "https://github.com/OCA/report-print-send", "license": "AGPL-3", - "depends": ["web"], + "depends": ["mail"], "data": [ "data/printing_data.xml", "security/security.xml", diff --git a/base_report_to_printer/models/__init__.py b/base_report_to_printer/models/__init__.py index 83553f6f06c..a7d99ea2084 100644 --- a/base_report_to_printer/models/__init__.py +++ b/base_report_to_printer/models/__init__.py @@ -1,4 +1,5 @@ from . import ir_actions_report +from . import mail_template from . import printing_action from . import printing_job from . import printing_printer diff --git a/base_report_to_printer/models/mail_template.py b/base_report_to_printer/models/mail_template.py new file mode 100644 index 00000000000..5aaaf8c9c31 --- /dev/null +++ b/base_report_to_printer/models/mail_template.py @@ -0,0 +1,19 @@ +# Copyright 2024 Tecnativa - Sergio Teruel +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class MailTemplate(models.Model): + _inherit = "mail.template" + + def generate_email(self, res_ids, fields): + """Ensure that any report rendered to send it by email not is sent to printer + directly if the report is setting to send it to printer. + For example, user set delivery slip report redirect to printer and + 'Send an email when picking is validated' is active, if we do not inject this + context the report will be send twice to printer. + """ + return super( + MailTemplate, self.with_context(must_skip_send_to_printer=True) + ).generate_email(res_ids, fields) diff --git a/base_report_to_printer/readme/CONTRIBUTORS.rst b/base_report_to_printer/readme/CONTRIBUTORS.rst index a046d905596..53a69062ac0 100644 --- a/base_report_to_printer/readme/CONTRIBUTORS.rst +++ b/base_report_to_printer/readme/CONTRIBUTORS.rst @@ -13,3 +13,8 @@ * Alexandre Fayolle * Matias Peralta * Akim Juillerat + +* `Tecnativa `_ + + * Sergio Teruel + * David Vidal diff --git a/base_report_to_printer/static/description/index.html b/base_report_to_printer/static/description/index.html index 98ebb98e25d..e39af642c0c 100644 --- a/base_report_to_printer/static/description/index.html +++ b/base_report_to_printer/static/description/index.html @@ -8,11 +8,10 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ +:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z 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 +274,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: gray; } /* line numbers */ +pre.code .ln { color: grey; } /* 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 +300,7 @@ span.pre { white-space: pre } -span.problematic, pre.problematic { +span.problematic { color: red } span.section-subtitle { @@ -510,14 +509,17 @@

Contributors

  • Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
  • Matias Peralta <mnp@adhoc.com.ar>
  • Akim Juillerat <akim.juillerat@camptocamp.com>
  • +
  • Tecnativa
      +
    • Sergio Teruel
    • +
    • David Vidal
    • +
    +
  • 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.