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
closesodoo/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>