[FIX] mail: forum reply shows as 'False'

When posting a comment after an answer in the forum, a mail
was sent to each subscriber with 'Re: False' as title.

In fact the title has to be 'Re:' + the name of the parent
record of this message.

When a mail is sent from the post, a link to access the subject
of the forum must be included in the mail.

opw:679073
This commit is contained in:
Goffin Simon
2016-06-14 14:44:58 +02:00
parent 3f16ddfe50
commit ca8a38d201
3 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -69,7 +69,7 @@
<meta itemprop="name" content="View ${ctx['model_name']}"/>
</div>
</div>
% if not ctx['is_discussion'] or not len(ctx['actions']) == 0:
% if not ctx['is_discussion'] or not len(ctx['actions']) == 0 or ctx.get('is_accessible'):
<div summary="o_mail_notification" style="padding:0px; width:600px; margin:0 auto; background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" style="width:600px; border-collapse:collapse; background:inherit; color:inherit">
<tbody><tr>
+3
View File
@@ -1814,6 +1814,9 @@ class MailThread(models.AbstractModel):
for x in ('from', 'to', 'cc'):
values.pop(x, None)
if not values['subject'] and self._name == 'forum.post':
values['record_name'] = self.parent_id and self.parent_id.name
# Post the message
new_message = MailMessage.create(values)
+2
View File
@@ -74,6 +74,7 @@ class Partner(models.Model):
tracking_value.get_new_display_value()[0]))
is_discussion = message.subtype_id.id == self.env['ir.model.data'].xmlid_to_res_id('mail.mt_comment')
is_accessible = message.model == "forum.post"
return {
'signature': signature,
@@ -83,6 +84,7 @@ class Partner(models.Model):
'record_name': record_name,
'tracking': tracking,
'is_discussion': is_discussion,
'is_accessible': is_accessible
}
@api.model