[FIX] mail, website_sale: remove unnecessary autofollow
When sending an email on an activity or a recovery email it is not necessary to automatically include all recipients as follower. If they perform an action on the record they will be added as follower. Same if they reply. Task-2612911 PR odoo/odoo#60792
This commit is contained in:
@@ -1082,7 +1082,7 @@ class MailActivityMixin(models.AbstractModel):
|
||||
template = self.env['mail.template'].browse(template_id).exists()
|
||||
if not template:
|
||||
return False
|
||||
for record in self.with_context(mail_post_autofollow=self.env.context.get('mail_post_autofollow', True)):
|
||||
for record in self:
|
||||
record.message_post_with_template(
|
||||
template_id,
|
||||
composition_mode='comment'
|
||||
|
||||
@@ -16,5 +16,4 @@ class MailComposeMessage(models.TransientModel):
|
||||
('cart_recovery_email_sent', '=', False),
|
||||
('is_abandoned_cart', '=', True)
|
||||
]).write({'cart_recovery_email_sent': True})
|
||||
self = self.with_context(mail_post_autofollow=self.env.context.get('mail_post_autofollow', True))
|
||||
return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)
|
||||
|
||||
Reference in New Issue
Block a user