Now that we're closer to switching to P3 for good, these helpers have outlived their usefulness, and mostly add noise. All remaining dict.iter*() or dict.view*() must be converted to the normal keys(), values() or items() calls. Whenever the result is likely to be used for more than the scope of a loop, or when the dict needs to be modified during iteration, the calls must be wrapped in a ``list()``, to protect the new P3 semantics. Those cases are very exceptional. Also removed some dead code or improved the API to remove unnecessary conversions.
19 lines
745 B
Python
19 lines
745 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo.addons.website_event.controllers.main import WebsiteEventController
|
|
|
|
|
|
class WebsiteEvent(WebsiteEventController):
|
|
|
|
def _process_registration_details(self, details):
|
|
''' Process data posted from the attendee details form. '''
|
|
registrations = super(WebsiteEvent, self)._process_registration_details(details)
|
|
for registration in registrations:
|
|
answer_ids = []
|
|
for key, value in registration.items():
|
|
if key.startswith('answer_ids-'):
|
|
answer_ids.append([4, int(value)])
|
|
registration['answer_ids'] = answer_ids
|
|
return registrations
|