[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#77095

X-original-commit: 1eb8cdec60a5f460f57669ce4336efbc5b0279c8
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
BVE
2021-09-27 12:21:18 +00:00
committed by Goffin Simon
parent 432d15a30e
commit 639ea1e362
+1 -1
View File
@@ -38,7 +38,7 @@ class CouponGenerate(models.TransientModel):
subject = _('%s, a coupon has been generated for you') % (partner.name)
del context
if self.template_id:
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}
self.template_id.send_mail(coupon.id, email_values=email_values, notif_layout='mail.mail_notification_light')
@api.depends('partners_domain')