Skip to content

Commit

Permalink
Tax receipt is now attached also on the printed version.
Browse files Browse the repository at this point in the history
  • Loading branch information
ecino committed Jan 18, 2022
1 parent 7c828be commit 7b56626
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions partner_communication_switzerland/models/partner_communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 7b56626

Please sign in to comment.