[FIX] loyalty: prevent to send mail during sale order manipulation

taskid: 2920026
This commit is contained in:
Arnaud Joset
2022-09-05 11:28:44 +02:00
committed by SEINLET Nicolas
parent ab191d6066
commit c5291f4cf4
+1 -1
View File
@@ -100,7 +100,7 @@ class LoyaltyCard(models.Model):
"""
Sends the 'At Creation' communication plan if it exist for the given coupons.
"""
if self.env.context.get('loyalty_no_mail', False):
if self.env.context.get('loyalty_no_mail', False) or self.env.context.get('action_no_send_mail', False):
return
# Ideally one per program, but multiple is supported
create_comm_per_program = dict()