From 0e42d8f1d219ed271f5f66f5dbf8eb472fe90383 Mon Sep 17 00:00:00 2001 From: houssine Date: Tue, 18 Jun 2019 18:37:27 +0200 Subject: [PATCH] [FIX] add sudo to by pass access right restriction on send mail --- easy_my_coop/models/coop.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/easy_my_coop/models/coop.py b/easy_my_coop/models/coop.py index a71d95b..19fb622 100644 --- a/easy_my_coop/models/coop.py +++ b/easy_my_coop/models/coop.py @@ -404,7 +404,8 @@ class SubscriptionRequest(models.Model): invoice_email_template = self.env['mail.template'].search([('name', '=', 'Request to Release Capital - Send by Email')])[0] # we send the email with the capital release request in attachment - invoice_email_template.send_mail(invoice.id, True) + # TODO remove sudo() and give necessary access right + invoice_email_template.sudo().send_mail(invoice.id, True) invoice.sent = True def get_journal(self):