summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2020-02-27 09:58:32 +0000
committerThibault Delavallée <tde@odoo.com>2020-02-27 13:16:11 +0000
commit3c70eb3d04c80069c3e8890f127ee7f5d86507de (patch)
treeb903bfbc6951b4c2dbd8f725cbaaae92e4e7eb11
parent9db8860840a149261d6d2a0ec404fc223f6b4d72 (diff)
[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
-rw-r--r--addons/website_event/controllers/main.py2
1 files changed, 1 insertions, 1 deletions
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