Skip to content

Commit

Permalink
Merge pull request #41106 from deepeshgarg007/heatmap_remove
Browse files Browse the repository at this point in the history
chore: Remove heatmap from party dashboards
  • Loading branch information
deepeshgarg007 committed Apr 24, 2024
2 parents cfa3c85 + a8f03e8 commit 5f6bf4c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 54 deletions.
46 changes: 0 additions & 46 deletions erpnext/accounts/party.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,52 +754,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)

Expand Down
4 changes: 0 additions & 4 deletions erpnext/buying/doctype/supplier/supplier_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

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": [
Expand Down
4 changes: 0 additions & 4 deletions erpnext/selling/doctype/customer/customer_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

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",
Expand Down

0 comments on commit 5f6bf4c

Please sign in to comment.