Skip to content

Commit

Permalink
[MIG] base_report_to_printer_mail: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wpichler committed Jan 6, 2025
1 parent bf7b6dc commit b893076
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 6 additions & 2 deletions base_report_to_printer_mail/models/mail_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
class MailTemplate(models.Model):
_inherit = "mail.template"

def generate_email(self, res_ids, fields=None):
def _generate_template(self, res_ids, render_fields, find_or_create_partners=False):
return super(
MailTemplate, self.with_context(must_skip_send_to_printer=True)
).generate_email(res_ids, fields=fields)
)._generate_template(
res_ids,
render_fields=render_fields,
find_or_create_partners=find_or_create_partners,
)
8 changes: 4 additions & 4 deletions base_report_to_printer_mail/tests/test_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def setUp(self):
"body_html": "<p>Dear ${object.name}, "
"your parent is ${object.parent_id and "
'object.parent_id.name or "False"}</p>',
"report_template": self.report.id,
"report_template_ids": [(4, self.report.id)],
}
)

Expand Down Expand Up @@ -89,9 +89,9 @@ def test_generate_email(self):
"printing_printer.PrintingPrinter."
"print_document"
) as print_document:
self.email_template.generate_email(
self.test_partner.id,
fields=[
self.email_template._generate_template(
[self.test_partner.id],
render_fields=[
"name",
"email_from",
"email_to",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
odoo-addon-base_report_to_printer @ git+https://github.com/OCA/report-print-send.git@refs/pull/371/head#subdirectory=base_report_to_printer
odoo-addon-base_report_to_printer @ git+https://github.com/OCA/report-print-send.git@refs/pull/371/head#subdirectory=base_report_to_printer

0 comments on commit b893076

Please sign in to comment.