From 7e1b75a705422b0a75b5c70fd735206df9db61cd Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 7 May 2014 18:44:02 +0530 Subject: [PATCH] Newsletter status display. Fixes #1593 --- erpnext/support/doctype/newsletter/newsletter.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/erpnext/support/doctype/newsletter/newsletter.py b/erpnext/support/doctype/newsletter/newsletter.py index 42f9f09c4f..4ac9f8ae85 100644 --- a/erpnext/support/doctype/newsletter/newsletter.py +++ b/erpnext/support/doctype/newsletter/newsletter.py @@ -16,6 +16,13 @@ class Newsletter(Document): from `tabBulk Email` where ref_doctype=%s and ref_docname=%s group by status""", (self.doctype, self.name))) or None) + def as_dict(self, no_nulls=False): + doc = super(Newsletter, self).as_dict(no_nulls) + if self.get("__status_count"): + doc["__status_count"] = self.get("__status_count") + + return doc + def test_send(self, doctype="Lead"): self.recipients = self.test_email_id.split(",") self.send_to_doctype = "Lead"