From 95ed72c3f304ea023e9c3f1581b606ebcc008e25 Mon Sep 17 00:00:00 2001 From: paul-schaefer <62424721+paul-schaefer@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:57:39 +0200 Subject: [PATCH] add sudo() to mail.mail create without the use of sudo() only administrators are allowed to use the module --- .../wizard/overdue_reminder_wizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_invoice_overdue_reminder/wizard/overdue_reminder_wizard.py b/account_invoice_overdue_reminder/wizard/overdue_reminder_wizard.py index 03ea39134..cd899c9bf 100644 --- a/account_invoice_overdue_reminder/wizard/overdue_reminder_wizard.py +++ b/account_invoice_overdue_reminder/wizard/overdue_reminder_wizard.py @@ -565,7 +565,7 @@ def generate_mail_vals(self): ) mvals.pop("attachment_ids", None) mvals.pop("attachments", None) - mail = self.env["mail.mail"].create(mvals) + mail = self.env["mail.mail"].sudo().create(mvals) inv_report = self.env["ir.actions.report"]._get_report_from_name( "account.report_invoice_with_payments" )