Untitled

mail@pastecode.io avatar
unknown
python
3 years ago
1.1 kB
2
Indexable
Never
@http.route(['/my/attraction/ticket/<int:ticket_id>'], type='http', auth="public", website=True)
    def tickets_followup(self, ticket_id, report_type=None, access_token=None, message=False, download=False, **kw):
        try:
            SeatBook = request.env['seat.book']
            seat_sudo = SeatBook.browse(ticket_id)
        except (AccessError, MissingError):
            return request.redirect('/my')
        if download == 'True':
            download = True
        if report_type in ('html', 'pdf', 'text'):
            return self._show_report(model=seat_sudo, report_type=report_type, report_ref='movie_booking_system.ticket_movie_book', download=download)

        values = {
            'seat_book': seat_sudo.sudo(),
            'message': message,
            'token': access_token,
            'return_url': '/shop/payment/validate',
            'bootstrap_formatting': True,
            'report_type': 'html',
            'page_name': 'seat',
        }

        return request.render('movie_booking_system.booking_ticket_portal_template', values)