summaryrefslogtreecommitdiff
path: root/addons/website_blog
diff options
context:
space:
mode:
authorXavier-Do <xdo@odoo.com>2019-04-12 13:21:18 +0000
committerThibault Delavallée <tde@odoo.com>2019-05-29 13:34:32 +0000
commitde7c119e666d108564b3889d1c08e5bf2e4da082 (patch)
tree3c24844df7072ba840d93fb1f2b141ad7a507fa3 /addons/website_blog
parent2fcb3c658df3e504b92ff9b5a805d150cfa7effd (diff)
[IMP] mail: reduce message_post query count and clean code
Purpose of this commit is to improve performance of post and notify through various code improvements. Containing * making of _notify_customize_recipients a mail.thread method; * _message_auto_subscribe_followers optimized; * renaming and optimisation of _notify_partners; * message_post_attachements optization; * remove unused mail_post_autofollow_partner_ids context key; * minimize message create queries; * only check record related access right for thread messages not in pending moderation; * get attachements from values instead of db; * storing lang in ctx from the beginning; * don't track on write on attachments; Related to task 1943901 Linked to PR #32404
Diffstat (limited to 'addons/website_blog')
-rw-r--r--addons/website_blog/models/website_blog.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/website_blog/models/website_blog.py b/addons/website_blog/models/website_blog.py
index 12676691977..6ddb0cb06a6 100644
--- a/addons/website_blog/models/website_blog.py
+++ b/addons/website_blog/models/website_blog.py
@@ -259,14 +259,14 @@ class BlogPost(models.Model):
return groups
@api.multi
- def _notify_customize_recipients(self, message, msg_vals, recipients_vals):
+ def _notify_customize_recipients(self, message, msg_vals):
""" Override to avoid keeping all notified recipients of a comment.
We avoid tracking needaction on post comments. Only emails should be
sufficient. """
msg_type = msg_vals.get('message_type') or message.message_type
if msg_type == 'comment':
return {'needaction_partner_ids': []}
- return {}
+ return super(BlogPost, self)._notify_customize_recipients(message, msg_vals)
def _default_website_meta(self):
res = super(BlogPost, self)._default_website_meta()