From 7b5662664f8bb4392e9ed938a079f84fe59b36ec Mon Sep 17 00:00:00 2001 From: Emanuel Cino Date: Tue, 18 Jan 2022 10:02:33 +0100 Subject: [PATCH] Tax receipt is now attached also on the printed version. --- .../models/partner_communication.py | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/partner_communication_switzerland/models/partner_communication.py b/partner_communication_switzerland/models/partner_communication.py index d45863174..1d0c0ddee 100644 --- a/partner_communication_switzerland/models/partner_communication.py +++ b/partner_communication_switzerland/models/partner_communication.py @@ -459,19 +459,16 @@ def get_end_sponsorship_certificate(self): def get_tax_receipt(self): self.ensure_one() - res = {} - if self.send_mode == "digital": - report_name = "report_compassion.tax_receipt" - data = { - "doc_ids": self.partner_id.ids, - "year": self.env.context.get("year", date.today().year - 1), - "lang": self.partner_id.lang, - } - pdf = self._get_pdf_from_data( - data, self.env.ref("report_compassion.tax_receipt_report") - ) - res = {_("tax receipt.pdf"): [report_name, pdf]} - return res + report_name = "report_compassion.tax_receipt" + data = { + "doc_ids": self.partner_id.ids, + "year": self.env.context.get("year", date.today().year - 1), + "lang": self.partner_id.lang, + } + pdf = self._get_pdf_from_data( + data, self.env.ref("report_compassion.tax_receipt_report") + ) + return {_("tax receipt.pdf"): [report_name, pdf]} @api.multi def send(self):