[optimize] communication query for heatmap
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index d348715..8d11374 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -7,7 +7,7 @@
 import datetime
 from frappe import _, msgprint, scrub
 from frappe.defaults import get_user_permissions
-from frappe.utils import add_days, getdate, formatdate, get_first_day, date_diff
+from frappe.utils import add_days, getdate, formatdate, get_first_day, date_diff, add_years
 from erpnext.utilities.doctype.address.address import get_address_display
 from erpnext.utilities.doctype.contact.contact import get_contact_details
 from erpnext.exceptions import PartyFrozen, InvalidCurrency, PartyDisabled, InvalidAccountCurrency
@@ -332,6 +332,8 @@
 def get_timeline_data(doctype, name):
 	'''returns timeline data for the past one year'''
 	from frappe.desk.form.load import get_communication_data
-	data = get_communication_data(doctype, name, fields = 'unix_timestamp(date(creation)), count(name)',
+	data = get_communication_data(doctype, name,
+		fields = 'unix_timestamp(date(creation)), count(name)',
+		after = add_years(None, -1).strftime('%Y-%m-%d'),
 		group_by='group by date(creation)', as_dict=False)
 	return dict(data)
\ No newline at end of file