Skip to content
Snippets Groups Projects
Commit 8d2f0675 authored by Jorge Pinna Puissant's avatar Jorge Pinna Puissant
Browse files

[FIX] sale: automatic invoice not send


- In an e-commerce with automatic invoice set;
- Buy something as public user;
- Pay the order;

Before this commit, the client don't receive the invoice confirmation
email.

opw-2176506

closes odoo/odoo#44494

X-original-commit: 684e678e1240f444ccdcd31939456fe57177b5b2
Signed-off-by: default avatarJorge Pinna Puissant (jpp) <jpp@odoo.com>
parent 62baa8a2
Branches
Tags
No related merge requests found
......@@ -3,7 +3,7 @@
import logging
import re
from odoo import api, fields, models, _
from odoo import api, fields, models, _, SUPERUSER_ID
from odoo.tools import float_compare
......@@ -121,7 +121,7 @@ class PaymentTransaction(models.Model):
mark_invoice_as_sent=True,
company_id=trans.acquirer_id.company_id.id,
)
for invoice in trans.invoice_ids:
for invoice in trans.invoice_ids.with_user(SUPERUSER_ID):
invoice.message_post_with_template(int(default_template), email_layout_xmlid="mail.mail_notification_paynow")
return res
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment