From 99d19caec14a58744ef0c64b343f00f6b4f0b85a Mon Sep 17 00:00:00 2001 From: Mayurrajsinh Rathod Date: Fri, 13 Oct 2023 13:02:15 +0000 Subject: [PATCH] [FIX] website_slides: correct auto_delete on mail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce ================== 1. Open course with enroll policy onInvitation or Click on three dot of any course in kanban view 2. Click on Invite > add a recipient 3. Go to mail template internal link  4. Go to setting tab 5. Disable the 'Auto delete' > save & close it  6. Click on Send 7. Go the Technical/Emails (in debug mode) 8. Send the mail by clicking 'Send now' Issue - Even if we unchecked auto delete still the mail is deleted automatically Technical ========= In the '_prepare_mail_values' method of the 'slide.channel.invite' model, the mail values for 'mail.mail' are prepared and the auto delete is set to True. After this commit ================= You can view the sent mails since the auto_delete is configured based on the template value for invitation. Task-3546212 closes odoo/odoo#141141 X-original-commit: 3d9640d5c24f345d67e4e74e62584e60cc27815b Signed-off-by: Warnon Aurélien (awa) --- addons/website_slides/wizard/slide_channel_invite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_slides/wizard/slide_channel_invite.py b/addons/website_slides/wizard/slide_channel_invite.py index 86149bb0a06..8fb2759486e 100644 --- a/addons/website_slides/wizard/slide_channel_invite.py +++ b/addons/website_slides/wizard/slide_channel_invite.py @@ -92,7 +92,7 @@ class SlideChannelInvite(models.TransientModel): mail_values = { 'attachment_ids': [(4, att.id) for att in self.attachment_ids], 'author_id': self.env.user.partner_id.id, - 'auto_delete': True, + 'auto_delete': self.template_id.auto_delete if self.template_id else True, 'body_html': body, 'email_from': self.env.user.email_formatted, 'model': None,