summaryrefslogtreecommitdiff
path: root/addons/website_event/controllers/main.py
diff options
context:
space:
mode:
authorDebauche Stéphane <std@odoo.com>2019-10-23 11:04:15 +0000
committerThibault Delavallée <tde@odoo.com>2020-01-08 09:11:50 +0000
commit412ff994f1120457c912aad487265e3de8a9f35a (patch)
tree0a1f655a383ab19338748f18b77907122ca600e4 /addons/website_event/controllers/main.py
parentd6706850502cb3f6d2505afd566e48e99fa4e88e (diff)
[IMP] event: replace state by kanban stage
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
Diffstat (limited to 'addons/website_event/controllers/main.py')
-rw-r--r--addons/website_event/controllers/main.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/website_event/controllers/main.py b/addons/website_event/controllers/main.py
index d5348aa7a4a..7e22470639e 100644
--- a/addons/website_event/controllers/main.py
+++ b/addons/website_event/controllers/main.py
@@ -92,7 +92,7 @@ class WebsiteEventController(http.Controller):
domain_search["country"] = [("country_id", "=", False)]
def dom_without(without):
- domain = [('state', "in", ['draft', 'confirm', 'done'])]
+ domain = []
for key, search in domain_search.items():
if key != without:
domain += search
@@ -203,7 +203,7 @@ class WebsiteEventController(http.Controller):
'event': event,
'main_object': event,
'range': range,
- 'registrable': event.sudo()._is_event_registrable(),
+ 'registrable': event.sudo().event_registrations_open,
'google_url': urls.get('google_url'),
'iCal_url': urls.get('iCal_url'),
}
@@ -242,9 +242,9 @@ class WebsiteEventController(http.Controller):
domain = request.website.website_domain()
if country_code:
country = request.env['res.country'].search([('code', '=', country_code)], limit=1)
- events = Event.search(domain + ['|', ('address_id', '=', None), ('country_id.code', '=', country_code), ('date_begin', '>=', '%s 00:00:00' % fields.Date.today()), ('state', '=', 'confirm')], order="date_begin")
+ events = Event.search(domain + ['|', ('address_id', '=', None), ('country_id.code', '=', country_code), ('date_begin', '>=', '%s 00:00:00' % fields.Date.today())], order="date_begin")
if not events:
- events = Event.search(domain + [('date_begin', '>=', '%s 00:00:00' % fields.Date.today()), ('state', '=', 'confirm')], order="date_begin")
+ events = Event.search(domain + [('date_begin', '>=', '%s 00:00:00' % fields.Date.today())], order="date_begin")
for event in events:
if country_code and event.country_id.code == country_code:
result['country'] = country