diff --git a/partner_communication_compassion/models/correspondence.py b/partner_communication_compassion/models/correspondence.py index d51ca1cf7..6a80b3d1d 100644 --- a/partner_communication_compassion/models/correspondence.py +++ b/partner_communication_compassion/models/correspondence.py @@ -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 diff --git a/partner_communication_compassion/models/partner_communication.py b/partner_communication_compassion/models/partner_communication.py index c3f1411bd..2c9cd6254 100644 --- a/partner_communication_compassion/models/partner_communication.py +++ b/partner_communication_compassion/models/partner_communication.py @@ -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() @@ -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):