summaryrefslogtreecommitdiff
path: root/addons/website_event_questions/controllers/main.py
diff options
context:
space:
mode:
authorRichard Mathot <rim@odoo.com>2015-02-17 15:00:35 +0100
committerRichard Mathot <rim@odoo.com>2015-02-19 11:22:59 +0100
commit194d95cd475b7e34ba7057ebdfc682624adac07f (patch)
tree8f94effc5f3a4adb643059e2d4295a8b4fbdba4b /addons/website_event_questions/controllers/main.py
parent2334917ed38f4f1c4ae832dfef331aad8995847e (diff)
[ADD] website_event_questions: ask questions to event attendees
[IMP] event,event_sale,website_event_sale: refactoring to be more easily extended (code portions are courtesy of Thibault Delavallée <tde@odoo.com>)
Diffstat (limited to 'addons/website_event_questions/controllers/main.py')
-rw-r--r--addons/website_event_questions/controllers/main.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/addons/website_event_questions/controllers/main.py b/addons/website_event_questions/controllers/main.py
new file mode 100644
index 00000000000..7d78d7fa11e
--- /dev/null
+++ b/addons/website_event_questions/controllers/main.py
@@ -0,0 +1,17 @@
+# -*- coding: utf-8 -*-
+
+from openerp.addons.website_event.controllers.main import website_event
+
+
+class website_event(website_event):
+
+ def _process_registration_details(self, details):
+ ''' Process data posted from the attendee details form. '''
+ registrations = super(website_event, self)._process_registration_details(details)
+ for registration in registrations:
+ answer_ids = []
+ for key, value in registration.iteritems():
+ if key.startswith('answer_ids-'):
+ answer_ids.append([4, int(value)])
+ registration['answer_ids'] = answer_ids
+ return registrations