Purpose ======= Remove the state on the event and add a stage. So, we can have more control on the event flow, and we will have less constrains. Website event ============= Before ------ People can register for an event if "seats are available" and if the state is "confirmed". After ----- People can register for an event if `event_registrations_open` is True, - Event: seats are available and the event is not finished - Event sale: One or more ticket has `sale_available` set to True Task #2088538
22 lines
764 B
Python
22 lines
764 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from werkzeug.exceptions import NotFound
|
|
|
|
from odoo.http import Controller, request, route, content_disposition
|
|
|
|
|
|
class EventController(Controller):
|
|
|
|
@route(['''/event/<model("event.event"):event>/ics'''], type='http', auth="public")
|
|
def event_ics_file(self, event, **kwargs):
|
|
files = event._get_ics_file()
|
|
if not event.id in files:
|
|
return NotFound()
|
|
content = files[event.id]
|
|
return request.make_response(content, [
|
|
('Content-Type', 'application/octet-stream'),
|
|
('Content-Length', len(content)),
|
|
('Content-Disposition', content_disposition('%s.ics' % event.name))
|
|
])
|