Skip to content

Commit

Permalink
removed unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Prazn committed Sep 2, 2024
1 parent 8c6757c commit 494fe4c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
24 changes: 0 additions & 24 deletions partner_communication_compassion/models/correspondence.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,30 +86,6 @@ def get_image(self):
data = super().get_image()
return data

def attach_zip(self):
"""
When a partner gets multiple letters, we make a zip and attach it
to the first letter, so that he can only download this zip.
:return: True
"""
if len(self) > 5:
_zip = (
self.env["correspondence.download.wizard"]
.with_context(active_model=self._name, active_ids=self.ids)
.create({})
)
_zip.get_letters()
self.write({"zip_file": False})
letter_attach = self[:1]
letter_attach.write(
{"zip_file": _zip.download_data, "letter_format": "zip"}
)
base_url = (
self.env["ir.config_parameter"].sudo().get_param("web.external.url")
)
self.write({"read_url": f"{base_url}/b2s_image?id={letter_attach.uuid}"})
return True

def compose_letter_image(self):
"""
Regenerate communication if already existing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PartnerCommunication(models.Model):

def get_correspondence_attachments(self, letters=None):
"""
Include PDF of letters if the send_mode is to print the letters.
Include PDF of letters.
:return: dict {attachment_name: [report_name, pdf_data]}
"""
self.ensure_one()
Expand All @@ -50,9 +50,6 @@ def get_correspondence_attachments(self, letters=None):
subject=_("Missing letter"),
)
continue
if self.send_mode != "physical":
# Attach directly a zip in the letters
letters.attach_zip()
return attachments

def final_letter_attachment(self):
Expand Down

0 comments on commit 494fe4c

Please sign in to comment.