summaryrefslogtreecommitdiff
path: root/addons/website_event_track
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 /addons/website_event_track
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>
Diffstat (limited to 'addons/website_event_track')
-rw-r--r--addons/website_event_track/models/event_track.py2
1 files changed, 2 insertions, 0 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)