From 410990b2a3a5632504ba67e3654523741da76eba Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 19 Apr 2024 19:09:55 +0530 Subject: [PATCH] chore: Remove heatmap from party dashboards (cherry picked from commit a8f03e8baa805bfa95aaaa55566d470d4de715e9) --- erpnext/accounts/party.py | 46 ------------------- .../doctype/supplier/supplier_dashboard.py | 4 -- .../doctype/customer/customer_dashboard.py | 4 -- 3 files changed, 54 deletions(-) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 722082fe0a4..70cd8ce1f97 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -751,52 +751,6 @@ def validate_party_frozen_disabled(party_type, party_name): frappe.msgprint(_("{0} {1} is not active").format(party_type, party_name), alert=True) -def get_timeline_data(doctype, name): - """returns timeline data for the past one year""" - from frappe.desk.form.load import get_communication_data - - out = {} - after = add_years(None, -1).strftime("%Y-%m-%d") - - data = get_communication_data( - doctype, - name, - after=after, - group_by="group by communication_date", - fields="C.communication_date as communication_date, count(C.name)", - as_dict=False, - ) - - # fetch and append data from Activity Log - activity_log = frappe.qb.DocType("Activity Log") - data += ( - frappe.qb.from_(activity_log) - .select(activity_log.communication_date, Count(activity_log.name)) - .where( - ( - ((activity_log.reference_doctype == doctype) & (activity_log.reference_name == name)) - | ((activity_log.timeline_doctype == doctype) & (activity_log.timeline_name == name)) - | ( - (activity_log.reference_doctype.isin(["Quotation", "Opportunity"])) - & (activity_log.timeline_name == name) - ) - ) - & (activity_log.status != "Success") - & (activity_log.creation > after) - ) - .groupby(activity_log.communication_date) - .orderby(activity_log.communication_date, order=frappe.qb.desc) - ).run() - - timeline_items = dict(data) - - for date, count in timeline_items.items(): - timestamp = get_timestamp(date) - out.update({timestamp: count}) - - return out - - def get_dashboard_info(party_type, party, loyalty_program=None): current_fiscal_year = get_fiscal_year(nowdate(), as_dict=True) diff --git a/erpnext/buying/doctype/supplier/supplier_dashboard.py b/erpnext/buying/doctype/supplier/supplier_dashboard.py index 3bd306e6591..9f424dd0c7c 100644 --- a/erpnext/buying/doctype/supplier/supplier_dashboard.py +++ b/erpnext/buying/doctype/supplier/supplier_dashboard.py @@ -3,10 +3,6 @@ from frappe import _ def get_data(): return { - "heatmap": True, - "heatmap_message": _( - "This is based on transactions against this Supplier. See timeline below for details" - ), "fieldname": "supplier", "non_standard_fieldnames": {"Payment Entry": "party", "Bank Account": "party"}, "transactions": [ diff --git a/erpnext/selling/doctype/customer/customer_dashboard.py b/erpnext/selling/doctype/customer/customer_dashboard.py index 1b2296381e8..161a3ba0c50 100644 --- a/erpnext/selling/doctype/customer/customer_dashboard.py +++ b/erpnext/selling/doctype/customer/customer_dashboard.py @@ -3,10 +3,6 @@ from frappe import _ def get_data(): return { - "heatmap": True, - "heatmap_message": _( - "This is based on transactions against this Customer. See timeline below for details" - ), "fieldname": "customer", "non_standard_fieldnames": { "Payment Entry": "party",