From 8d994cb1f223856557a6f13e122b908a465650e0 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Mon, 22 Jul 2019 03:26:40 +0530 Subject: [PATCH] fix: allow only 1 active Email Campaign for a lead/contact at a time --- erpnext/crm/doctype/email_campaign/email_campaign.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/crm/doctype/email_campaign/email_campaign.py b/erpnext/crm/doctype/email_campaign/email_campaign.py index fa4a4ed67fc..8821fd59e22 100644 --- a/erpnext/crm/doctype/email_campaign/email_campaign.py +++ b/erpnext/crm/doctype/email_campaign/email_campaign.py @@ -42,7 +42,7 @@ class EmailCampaign(Document): frappe.throw(_("Please set an email id for lead communication")) def validate_email_campaign_already_exists(self): - if frappe.db.get_value("Email Campaign", {"campaign_name": self.campaign_name, "recipient": self.recipient, "status": "Active"}): + if frappe.db.get_value("Email Campaign", {"campaign_name": self.campaign_name, "recipient": self.recipient, "status": "In Progress"}): frappe.throw(_("The Campaign '{0}' already exists for the {1} '{2}'").format(self.campaign_name, self.email_campaign_for, self.recipient)) def update_status(self):