From d625c32ab16979186d146226dc1f9503d23c1cec Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 11 Apr 2019 16:13:58 +0530 Subject: [PATCH] fix(dashboard): for frappe updates, and a new splash logo --- .../account_balance_timeline.py | 11 +++++--- erpnext/hooks.py | 2 +- erpnext/public/images/erpnext-12.svg | 26 +++++++++++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 erpnext/public/images/erpnext-12.svg diff --git a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py index e2f4e12ab4..3063606f94 100644 --- a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py +++ b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py @@ -2,7 +2,7 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe, json from frappe.core.page.dashboard.dashboard import cache_source, get_from_date_from_timespan from frappe.utils import add_to_date, date_diff, getdate, nowdate from erpnext.accounts.report.general_ledger.general_ledger import execute @@ -11,16 +11,19 @@ from frappe.utils.nestedset import get_descendants_of @frappe.whitelist() @cache_source -def get(chart_name=None, filters=None): +def get(chart_name=None, from_date = None, to_date = None): chart = frappe.get_doc('Dashboard Chart', chart_name) timespan = chart.timespan timegrain = chart.time_interval + filters = json.loads(chart.filters_json) account = filters.get("account") company = filters.get("company") - from_date = get_from_date_from_timespan(timespan) - to_date = nowdate() + if not from_date: + from_date = get_from_date_from_timespan(to_date, timespan) + if not to_date: + to_date = nowdate() # fetch dates to plot dates = get_dates_from_timegrain(from_date, to_date, timegrain) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 608e8b2225..d8532fa116 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -74,7 +74,7 @@ website_generators = ["Item Group", "Item", "BOM", "Sales Partner", website_context = { "favicon": "/assets/erpnext/images/favicon.png", - "splash_image": "/assets/erpnext/images/erp-icon.svg" + "splash_image": "/assets/erpnext/images/erpnext-12.svg" } website_route_rules = [ diff --git a/erpnext/public/images/erpnext-12.svg b/erpnext/public/images/erpnext-12.svg new file mode 100644 index 0000000000..fcc8e46fdd --- /dev/null +++ b/erpnext/public/images/erpnext-12.svg @@ -0,0 +1,26 @@ + + + + version-12 + Created with Sketch. + + + + + + + + + + + + + + + + + 12 + + + + \ No newline at end of file