summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstd-odoo <std@odoo.com>2021-04-27 09:18:10 +0000
committerstd-odoo <std@odoo.com>2021-05-03 12:53:59 +0000
commit45ffab08a7c1dacc70d331077198f92884b53646 (patch)
tree6f213d34139a17ba9f5edd6aa681d59179c6ed31
parent7c0da92c486c2ab89fe424ce66904aa6a655fa09 (diff)
[FIX] website_event_track: fix new track notifications by email
Bug === 1. Create an event which allows track proposal 2. Follow it and subscribe to "New Track" 3. Log in in incognito and submit a proposal The email is not sent, because it's sent as the public user, which has no email address set. And so it the 2 system parameters <mail.catchall.domain> and <mail.default.from> are not set, we can not know which email address used to send the email. Note that this bug also occurs if you create a track with a user without an email address set. Task 2510181 closes odoo/odoo#69890 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
-rw-r--r--addons/website_event_track/models/event_track.py2
-rw-r--r--odoo/addons/base/models/ir_mail_server.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/addons/website_event_track/models/event_track.py b/addons/website_event_track/models/event_track.py
index e4b7c635d0b..ea62618405b 100644
--- a/addons/website_event_track/models/event_track.py
+++ b/addons/website_event_track/models/event_track.py
@@ -322,11 +322,13 @@ class Track(models.Model):
tracks = super(Track, self).create(vals_list)
for track in tracks:
+ email_values = {} if self.env.user.email else {'email_from': self.env.company.catchall_formatted}
track.event_id.message_post_with_view(
'website_event_track.event_track_template_new',
values={'track': track},
subject=track.name,
subtype_id=self.env.ref('website_event_track.mt_event_track').id,
+ **email_values,
)
track._synchronize_with_stage(track.stage_id)
diff --git a/odoo/addons/base/models/ir_mail_server.py b/odoo/addons/base/models/ir_mail_server.py
index 989daa7d64d..15a2faf19ea 100644
--- a/odoo/addons/base/models/ir_mail_server.py
+++ b/odoo/addons/base/models/ir_mail_server.py
@@ -284,7 +284,7 @@ class IrMailServer(models.Model):
"""
email_from = email_from or self._get_default_from_address()
assert email_from, "You must either provide a sender address explicitly or configure "\
- "using the combintion of `mail.catchall.domain` and `mail.default.from` "\
+ "using the combination of `mail.catchall.domain` and `mail.default.from` "\
"ICPs, in the server configuration file or with the "\
"--email-from startup parameter."