From ef73452abe80fe213f1d25cd2aa2ae90d94a0c45 Mon Sep 17 00:00:00 2001 From: Sahil Khan Date: Wed, 10 Apr 2019 15:29:49 +0530 Subject: [PATCH 1/2] feat(sync_site): return erpnext data in levels --- erpnext/utilities/activation.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/erpnext/utilities/activation.py b/erpnext/utilities/activation.py index 16391e073e2..8e59bdc966b 100644 --- a/erpnext/utilities/activation.py +++ b/erpnext/utilities/activation.py @@ -48,7 +48,27 @@ def get_level(): if frappe.db.sql('select name from tabUser where last_login > date_sub(now(), interval 2 day) limit 1'): activation_level += 1 - return activation_level + level = {"activation_level": 10, "sales_data": [ + {"Item": frappe.db.count('Item')}, + {"Sales Order": frappe.db.count('Sales Order')}, + {"Purchase Order": frappe.db.count('Purchase Order')}, + {"Employee": frappe.db.count('Employee')}, + {"Lead": frappe.db.count('Lead')}, + {"Payment Entry": frappe.db.count('Payment Entry')}, + {"Communication": frappe.db.count('Communication')}, + {"User": frappe.db.count('User')}, + {"Student": frappe.db.count('Student')}, + {"Instructor": frappe.db.count('Instructor')}, + {"Sales Invoice": frappe.db.count('Sales Invoice')}, + {"BOM": frappe.db.count('BOM')}, + {"Quotation": frappe.db.count('Quotation')}, + {"Lead": frappe.db.count('Lead')}, + {"Payment Entry": frappe.db.count('Payment Entry')}, + {"Journal Entry": frappe.db.count('Journal Entry')}, + {"Stock Entry": frappe.db.count('Stock Entry')}, + ]} + + return level def get_help_messages(): '''Returns help messages to be shown on Desktop''' From 0ac4cfa9b1aded3175f22664c58e5dac3b786800 Mon Sep 17 00:00:00 2001 From: Sahil Khan Date: Wed, 10 Apr 2019 15:29:49 +0530 Subject: [PATCH 2/2] fix(site_sync): remove duplicate entry --- erpnext/utilities/activation.py | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/utilities/activation.py b/erpnext/utilities/activation.py index 8e59bdc966b..559f8f63e70 100644 --- a/erpnext/utilities/activation.py +++ b/erpnext/utilities/activation.py @@ -62,7 +62,6 @@ def get_level(): {"Sales Invoice": frappe.db.count('Sales Invoice')}, {"BOM": frappe.db.count('BOM')}, {"Quotation": frappe.db.count('Quotation')}, - {"Lead": frappe.db.count('Lead')}, {"Payment Entry": frappe.db.count('Payment Entry')}, {"Journal Entry": frappe.db.count('Journal Entry')}, {"Stock Entry": frappe.db.count('Stock Entry')},