From 3c70eb3d04c80069c3e8890f127ee7f5d86507de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 27 Feb 2020 09:58:32 +0000 Subject: [PATCH] [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 cb928ed6133bc3d2104fbf586bba5cae2a482524 X-original-commit: 7c1acba32d814ec287c60d0a95f3911d51678932 --- addons/website_event/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_event/controllers/main.py b/addons/website_event/controllers/main.py index 84fa751112e..570074d7b4b 100644 --- a/addons/website_event/controllers/main.py +++ b/addons/website_event/controllers/main.py @@ -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