Commit Graph
1 Commits
Author SHA1 Message Date
Nicolas Galler ac9c9529b5 [FIX] product_email_template: use superuser account to send email in su mode
Behavior prior to the fix:

The email template associated with a product on an invoice placed via
the web portal is sent with no email_from, resulting in a failure.  The
reason is that before 13.0 .sudo() before sending a mail would send it
as superuser user (which was the intention in this case), but since 13.0
for the same intention we need .with_user(SUPERUSER_ID).

Behavior after the fix:

When sending the product email, if we are in SU mode, we'll switch to
the super user account, emulating the pre-13.0 behavior.

Similar fix to b12bcfbb1b

opw-2346415

closes odoo/odoo#60584

X-original-commit: 43718d0694d8d0c7b53e3511cb8523a645ebddb1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Nicolas Galler <nicocrm@users.noreply.github.com>
2020-10-23 07:17:53 +00:00