Skip to content

Commit

Permalink
[FIX] website_event_attendee_fields: при создании контакта, нормализу…
Browse files Browse the repository at this point in the history
…ем почту
  • Loading branch information
em230418 committed Dec 28, 2024
1 parent 63bd2eb commit 72bcfa2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions website_event_attendee_fields/models/event_registration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging

from odoo import _, api, models
from odoo.tools.mail import email_normalize

_logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion website_event_attendee_fields/static/src/js/test_tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
},
Expand Down

0 comments on commit 72bcfa2

Please sign in to comment.