Skip to content
Snippets Groups Projects
Commit a4d50b46 authored by Stéphane Debauche's avatar Stéphane Debauche Committed by Thibault Delavallée
Browse files

[FIX] event: keep default values when registering from frontend

Purpose
=======

When creating an attendee from frontend some fields may be added in
parameters, notably through inheritance (questions, ...). We want the
defaults values to have the priority on those parameters (e.g. barcode code).

Task ID-2322411
PR odoo/odoo#
parent 9cf49ba3
No related branches found
No related tags found
No related merge requests found
......@@ -450,7 +450,11 @@ class EventRegistration(models.Model):
'partner_id': partner_id.id,
'event_id': event_id and event_id.id or False,
}
data.update({key: value for key, value in registration.items() if key in self._fields})
data.update({
key: value for key, value in registration.items()
if key in self._fields and key not in data and not self._fields[key].default
})
return data
def do_draft(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment