Skip to content
Snippets Groups Projects
Commit 01ec8048 authored by bve-odoo's avatar bve-odoo Committed by BVE
Browse files

[FIX] sale_coupon: Coupon mail sent twice


When generating coupons for customers, the email was sent twice due to the values
given on the email_values that is generating a TO (email_to) value (plus using the one given on the template
(recipients_ids))

opw:2574046

closes odoo/odoo#74406

X-original-commit: c99b6ab0a79cf605d78aaa2f9bb00faa192f7fcc
Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
Co-authored-by: default avatarsimongoffin <sig@odoo.com>
parent bd2d72c0
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ class CouponGenerate(models.TransientModel):
del context
template = self.env.ref('coupon.mail_template_sale_coupon', raise_if_not_found=False)
if template:
email_values = {'email_to': partner.email, 'email_from': self.env.user.email or '', 'subject': subject}
email_values = {'email_from': self.env.user.email or '', 'subject': subject}
template.send_mail(coupon.id, email_values=email_values, notif_layout='mail.mail_notification_light')
@api.depends('partners_domain')
......
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