[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:
Thibault Delavallée
2020-02-27 13:16:11 +00:00
parent 9db8860840
commit 3c70eb3d04
+1 -1
View File
@@ -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