ERPNext Conference 2019* ERPNext.com Blog

How I can Create dashboard to new custom doctype


#1

How I can Create dashboard veiw to new custom doctype


#2

Have you tried this, with what result? https://erpnext.com/docs/user/manual/en/customize-erpnext/dashboard


#3

Thanks @clarkej

I mean dashboard like this in doctype


#4

I wonder what Duplicate does to an existing DocType - that would be worth digging into - search here for pointers and do some trial and error learning?


#5

You have to create a .py file named “your_doctype”_dashboard.py in your doctype folder on the server. With this file you can define how your dashboard should look like


#6

Thanks for the learning joelios - here are lots of cases

frappe@ubuntu:~/frappe-bench$ find . -name '*_dashboard.py'
./apps/erpnext/erpnext/healthcare/doctype/patient_appointment/patient_appointment_dashboard.py
./apps/erpnext/erpnext/healthcare/doctype/inpatient_record/inpatient_record_dashboard.py
./apps/erpnext/erpnext/healthcare/doctype/patient_encounter/patient_encounter_dashboard.py
./apps/erpnext/erpnext/healthcare/doctype/patient/patient_dashboard.py
./apps/erpnext/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner_dashboard.py
./apps/erpnext/erpnext/projects/doctype/project/project_dashboard.py
[snip]

#7

Youre welcome.

Don’t forget, if you want to include a heatmap in the dashboard; the xxx_dashboard.py makes only the heatmap visible, to feed it with data you need a get_timeline_data() function within the “doctype”.py file.


#8

thanks Mr @joelios
I did it before asking here but there were no changes
So after that commited my changes and excuted bench update that solved my Issue

Best Regards