From de7c119e666d108564b3889d1c08e5bf2e4da082 Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Fri, 12 Apr 2019 13:21:18 +0000 Subject: [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 --- addons/mail/wizard/mail_compose_message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/mail/wizard/mail_compose_message.py') diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index 2db6a3d8324..1d54406b086 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -367,7 +367,7 @@ class MailComposer(models.TransientModel): mail_values.pop('attachments', []), attachment_ids, {'model': 'mail.message', 'res_id': 0} - ) + )['attachment_ids'] # Filter out the blacklisted records by setting the mail state to cancel -> Used for Mass Mailing stats if res_id in blacklisted_rec_ids: mail_values['state'] = 'cancel' -- cgit v1.2.3