[FIX] website_event: correctly support registrations without ticket
Current code handles "no ticket registration" having ticket_id set to 0
as a valid event.event.ticket ID. We fix that issue by correctly setting
the many2one to False.
Followup of cb928ed613
X-original-commit: 7c1acba32d814ec287c60d0a95f3911d51678932
This commit is contained in:
@@ -303,7 +303,7 @@ class WebsiteEventController(http.Controller):
|
||||
if field_name not in registration_fields:
|
||||
continue
|
||||
elif isinstance(registration_fields[field_name], (fields.Many2one, fields.Integer)):
|
||||
value = int(value)
|
||||
value = int(value) or False # 0 is considered as a void many2one aka False
|
||||
else:
|
||||
value = value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user