Some checks failed
Frontend / Unit Tests & Coverage (push) Has been skipped
Regenerate POT file (translatable strings) / Regenerate POT file (develop) (push) Failing after 1m13s
Regenerate POT file (translatable strings) / Regenerate POT file (main-hotfix) (push) Failing after 6s
Server / Tests (frappe ${{ matrix.frappe-branch }}) (push) Has been skipped
Server / Resolve frappe matrix (push) Failing after 1s
Frontend / Lint (push) Failing after 1s
Frontend / Production Build (push) Failing after 1s
Server / Coverage Wrap Up (push) Has been skipped
Frontend / Coverage Wrap Up (push) Has been skipped
37 lines
801 B
Python
37 lines
801 B
Python
import frappe
|
|
|
|
|
|
def get_site_info(site_info):
|
|
# called via hook
|
|
return {"activation": get_sales_data(site_info)}
|
|
|
|
|
|
def get_sales_data(site_info):
|
|
activation_level = site_info.get("activation", {}).get("activation_level", 0)
|
|
sales_data = site_info.get("activation", {}).get("sales_data", [])
|
|
doctypes = [
|
|
"CRM Lead",
|
|
"CRM Deal",
|
|
"CRM Organization",
|
|
"Contact",
|
|
"CRM Task",
|
|
"FCRM Note",
|
|
"CRM Call Log",
|
|
"CRM Lead Status",
|
|
"CRM Deal Status",
|
|
"CRM Lead Source",
|
|
"CRM Industry",
|
|
"CRM Territory",
|
|
"CRM Lost Reason",
|
|
"CRM Product",
|
|
"CRM Form Script",
|
|
"CRM Fields Layout",
|
|
"CRM View Settings",
|
|
]
|
|
|
|
for doctype in doctypes:
|
|
count = frappe.db.count(doctype)
|
|
sales_data.append({doctype: count})
|
|
|
|
return {"activation_level": activation_level, "sales_data": sales_data}
|