'Event Question main report'

@api.model_cr
def init(self):

    tools.drop_view_if_exists(self._cr, 'event_question_report')
    self._cr.execute('    CREATE    VIEW    event_question_report    AS    (\n                                                SELECT\n                                                                att_answer.id    as    id,\n                                                                att_answer.event_registration_id    as    attendee_id,\n                                                                answer.question_id    as    question_id,\n                                                                answer.id    as    answer_id,\n                                                                question.event_id    as    event_id\n                                                FROM\n                                                                event_registration_answer    as    att_answer\n                                                LEFT    JOIN\n                                                                event_answer    as    answer    ON    answer.id    =    att_answer.event_answer_id\n                                                LEFT    JOIN\n                                                                event_question    as    question    ON    question.id    =    answer.question_id\n                                                GROUP    BY\n                                                                attendee_id,\n                                                                event_id,\n                                                                question_id,\n                                                                answer_id,\n                                                                att_answer.id\n                                )')
