Skip to content
Snippets Groups Projects
Commit c0ffeeb4 authored by Nans Lefebvre's avatar Nans Lefebvre
Browse files

[FIX] website_sale: select cart recovery mail template in action

Fine-tuning of commit 50217184
The selection of the cart recovery mail template would fail if there was more
than one sale order selected.

opw 1921714

closes odoo/odoo#30885
parent 7d1957da
No related branches found
No related tags found
No related merge requests found
......@@ -316,7 +316,8 @@ class SaleOrder(models.Model):
try:
default_template = self.env.ref('website_sale.mail_template_sale_cart_recovery', raise_if_not_found=False)
default_template_id = default_template.id if default_template else False
template_id = self.website_id and self.website_id.cart_recovery_mail_template_id.id or default_template_id
template_id = (self.filtered('website_id') == self and
self.mapped('website_id')[-1:1].cart_recovery_mail_template_id.id) or default_template_id
except:
template_id = False
return {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment