From ffa589861bfcb800926592bb3a67b59ebd964caa Mon Sep 17 00:00:00 2001 From: std-odoo Date: Thu, 9 Feb 2023 11:31:32 +0000 Subject: [PATCH] [FIX] mail: revert the unlink in batch of the Bug === The unlink of the in the CRON is problematic because we accumulate a lot of records, and the CRON timeout. In particular, when we sent a mailing, we receive the "opened" event (blank image in the email), and so we need to update the mailing trace. But, if we unlink the mail at the same time, it locked the mailing trace table and we couldn't write the new value. The reason for that is that before, the unlink took more queries, but it was done one record at a time, so we could commit the change and release the lock between each unlink. Task-3179157 See odoo/odoo/pull/73271 closes odoo/odoo#112331 Related: odoo/upgrade#4320 Signed-off-by: Thibault Delavallee (tde) --- addons/mail/models/mail_mail.py | 2 -- addons/mail/views/mail_mail_views.xml | 2 -- addons/test_mail_full/tests/test_mail_performance.py | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/mail/models/mail_mail.py b/addons/mail/models/mail_mail.py index ffcd806c6bb..5771cca328a 100644 --- a/addons/mail/models/mail_mail.py +++ b/addons/mail/models/mail_mail.py @@ -84,8 +84,6 @@ class MailMail(models.Model): auto_delete = fields.Boolean( 'Auto Delete', help="This option permanently removes any track of email after it's been sent, including from the Technical menu in the Settings, in order to preserve storage space of your Odoo database.") - # Unused since v16, to remove in master. - to_delete = fields.Boolean('To Delete', help='If set, the mail will be deleted during the next Email Queue CRON run.') scheduled_date = fields.Datetime('Scheduled Send Date', help="If set, the queue manager will send the email after the date. If not set, the email will be send as soon as possible. Unless a timezone is specified, it is considered as being in UTC timezone.") fetchmail_server_id = fields.Many2one('fetchmail.server', "Inbound Mail Server", readonly=True) diff --git a/addons/mail/views/mail_mail_views.xml b/addons/mail/views/mail_mail_views.xml index 16270994f6d..721d01606d7 100644 --- a/addons/mail/views/mail_mail_views.xml +++ b/addons/mail/views/mail_mail_views.xml @@ -46,7 +46,6 @@ - @@ -98,7 +97,6 @@ -