def METHOD_NAME(self):
    for attachment_out in self:
        if attachment_out.state != "ready":
            raise UserError(
                _("You can only delete files in 'Ready to Send' state.")
            )
        for invoice in attachment_out.out_invoice_ids:
            invoice.fatturapa_doc_attachments.filtered(
                "is_pdf_invoice_print"
            ).METHOD_NAME()
    return super(FatturaPAAttachment, self).METHOD_NAME()