chore: Fixtures using new sync api
This commit is contained in:
parent
4a73bc672b
commit
d99f85bf3c
28
erpnext/buying/dashboard_fixtures.py
Normal file
28
erpnext/buying/dashboard_fixtures.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
import frappe
|
||||
import json
|
||||
|
||||
|
||||
def get_data():
|
||||
return frappe._dict({
|
||||
"dashboards": get_dashboards(),
|
||||
"charts": get_charts(),
|
||||
"number_cards": get_number_cards(),
|
||||
})
|
||||
|
||||
def get_dashboards():
|
||||
return [{
|
||||
"name": "<name>",
|
||||
"dashboard_name": "<name>",
|
||||
"charts": [
|
||||
{ "chart": <chart-name> }
|
||||
]
|
||||
}]
|
||||
|
||||
def get_charts():
|
||||
return [ { ... } ]
|
||||
|
||||
def get_number_cards():
|
||||
return [ { ... } ]
|
@ -134,87 +134,6 @@ def get_default_dashboards():
|
||||
"document_type": "Patient Appointment",
|
||||
"type": "Line",
|
||||
"width": "Half"
|
||||
},
|
||||
{
|
||||
"doctype": "Dashboard Chart",
|
||||
"owner": "Administrator",
|
||||
"report_name": "Purchase Analytics",
|
||||
"filters_json": json.dumps({
|
||||
"tree_type": "Item",
|
||||
"doc_type": "Purchase Receipt",
|
||||
"value_quantity": "Value",
|
||||
"from_date": "2020-03-01",
|
||||
"to_date": "2020-07-31",
|
||||
"company": company.name,
|
||||
"range": "Weekly"
|
||||
}),
|
||||
"type": "Line",
|
||||
'timeseries': 0,
|
||||
"chart_type": "Report",
|
||||
"chart_name": "Purchase Analytics",
|
||||
"custom_options": json.dumps({
|
||||
"x_field": "entity",
|
||||
"chart_type": "Bar",
|
||||
"y_axis_fields": [{"idx": 1, "__islocal": "true", "y_field": "total"}],
|
||||
"y_fields": ["total"]
|
||||
})
|
||||
},
|
||||
{
|
||||
"doctype": "Dashboard Chart",
|
||||
"owner": "Administrator",
|
||||
"document_type": "Material Request",
|
||||
"filters_json": '[["Material Request","status","not in",["Draft","Cancelled","Stopped",null],false],["Material Request","material_request_type","=","Purchase",false],["Material Request","company","=", "{company}", false]]'.format(company=company.name),
|
||||
"is_custom": 0,
|
||||
"type": "Donut",
|
||||
"timeseries": 0,
|
||||
"chart_type": "Group By",
|
||||
"group_by_based_on": "status",
|
||||
"chart_name": "Material Request Purchase Analysis",
|
||||
"group_by_type": "Count",
|
||||
"custom_options": json.dumps({"height": 300})
|
||||
|
||||
},
|
||||
{
|
||||
"doctype": "Dashboard Chart",
|
||||
"owner": "Administrator",
|
||||
"report_name": "Purchase Order Analysis",
|
||||
"filters_json": json.dumps({
|
||||
"company": company.name,
|
||||
"from_date": "2020-04-04",
|
||||
"to_date": "2020-07-04",
|
||||
"chart_based_on": "Quantity"
|
||||
}),
|
||||
"is_custom": 1,
|
||||
"type": "Donut",
|
||||
"timeseries": 0,
|
||||
"chart_type": "Report",
|
||||
"chart_name": "Purchase Order Analysis",
|
||||
"custom_options": json.dumps({
|
||||
"type": "donut",
|
||||
"height": 300,
|
||||
"axisOptions": {"shortenYAxisNumbers": 1}
|
||||
})
|
||||
},
|
||||
{
|
||||
"doctype": "Dashboard Chart",
|
||||
"owner": "Administrator",
|
||||
"report_name": "Requested Items to Order",
|
||||
"filters_json": json.dumps({
|
||||
"company": company.name,
|
||||
"from_date": "2020-04-01",
|
||||
"to_date": "2020-07-01",
|
||||
"group_by_mr": 0
|
||||
}),
|
||||
"is_custom": 1,
|
||||
"type": "Bar",
|
||||
"timeseries": 0,
|
||||
"chart_type": "Report",
|
||||
"chart_name": "Requested Items to Order",
|
||||
"custom_options": json.dumps({
|
||||
"type": "bar",
|
||||
"barOptions": {"stacked": 1},
|
||||
"axisOptions": {"shortenYAxisNumbers": 1}
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user