Skip to content

Commit

Permalink
[FIX] l10n_ch_invoice_reports should_print_invoice_attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
santostelmo committed Jul 5, 2024
1 parent 8265e52 commit 91b9c35
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions l10n_ch_invoice_reports/models/mail_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@ def _should_print_invoice_attachment(self):
# report name is not mandatory and odoo implementation does not rely on it
# but in this case we assume that this is report linked to the template
if (
self.model_id.model == "account.move"
self.env.user.company_id.partner_id.country_id.code == "CH"
and self.model_id.model == "account.move"
and self.report_template.report_name
== "l10n_ch_invoice_reports.account_move_payment_report"
in (
# Called from action Invoice with payment slip(s)
"l10n_ch_invoice_reports.account_move_payment_report",
# Called from Send & Print button
"account.report_invoice_with_payments")
):
return True

Expand Down

0 comments on commit 91b9c35

Please sign in to comment.