diff --git a/website_event_attendee_fields/models/event_registration.py b/website_event_attendee_fields/models/event_registration.py index 373594d..a7f90e2 100644 --- a/website_event_attendee_fields/models/event_registration.py +++ b/website_event_attendee_fields/models/event_registration.py @@ -1,6 +1,7 @@ import logging from odoo import _, api, models +from odoo.tools.mail import email_normalize _logger = logging.getLogger(__name__) @@ -100,6 +101,9 @@ def _prepare_partner_for_attendee_fields(self, vals): fname = q.partner_field_name res[fname] = vals.pop(fname, False) + if res.get("email"): + res["email"] = email_normalize(res["email"]) + # Don't pass empty value, because it removes previous value. # E.g. when partner with email is specified # And known fields are not filled at the form diff --git a/website_event_attendee_fields/static/src/js/test_tour.js b/website_event_attendee_fields/static/src/js/test_tour.js index d602d23..4d90077 100644 --- a/website_event_attendee_fields/static/src/js/test_tour.js +++ b/website_event_attendee_fields/static/src/js/test_tour.js @@ -52,7 +52,7 @@ registry $("input[name^='2-name']").val("Att2"); $("input[name^='2-phone']").val("222 222"); - $("input[name^='2-email']").val("att2@example.com"); + $("input[name^='2-email']").val("Att2@example.com"); $("select[name^='2-country_id']").val("1"); $("input[name^='2-function']").val("JOB2"); },