From 9b59fb659b9a47d7c626dd34c4ad7d85552511c4 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 17:26:17 +0530 Subject: [PATCH] fix: use db_set in email_campaign (backport #45679) (#48806) Bug fix in email_campaign's update_status function. (#45679) During the scheduler event of set_email_campaign_status, the function calling update_status isn't saving the modified status field. (cherry picked from commit 88e68bb803963d7d44c724c6dbf0be97a5037531) Co-authored-by: harshpwctech <84438948+harshpwctech@users.noreply.github.com> --- erpnext/crm/doctype/email_campaign/email_campaign.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/crm/doctype/email_campaign/email_campaign.py b/erpnext/crm/doctype/email_campaign/email_campaign.py index f8fce7ab697..6bfa4f8b3cb 100644 --- a/erpnext/crm/doctype/email_campaign/email_campaign.py +++ b/erpnext/crm/doctype/email_campaign/email_campaign.py @@ -78,11 +78,11 @@ class EmailCampaign(Document): end_date = getdate(self.end_date) today_date = getdate(today()) if start_date > today_date: - self.status = "Scheduled" + self.db_set("status", "Scheduled", update_modified=False) elif end_date >= today_date: - self.status = "In Progress" + self.db_set("status", "In Progress", update_modified=False) elif end_date < today_date: - self.status = "Completed" + self.db_set("status", "Completed", update_modified=False) # called through hooks to send campaign mails to leads