style: format code with black
This commit is contained in:
@@ -13,6 +13,7 @@ def get_company_for_dashboards():
|
||||
return company_list[0].name
|
||||
return None
|
||||
|
||||
|
||||
def get_default_dashboards():
|
||||
company = frappe.get_doc("Company", get_company_for_dashboards())
|
||||
income_account = company.default_income_account or get_account("Income Account", company.name)
|
||||
@@ -25,20 +26,18 @@ def get_default_dashboards():
|
||||
"doctype": "Dashboard",
|
||||
"dashboard_name": "Accounts",
|
||||
"charts": [
|
||||
{ "chart": "Outgoing Bills (Sales Invoice)" },
|
||||
{ "chart": "Incoming Bills (Purchase Invoice)" },
|
||||
{ "chart": "Bank Balance" },
|
||||
{ "chart": "Income" },
|
||||
{ "chart": "Expenses" },
|
||||
{ "chart": "Patient Appointments" }
|
||||
]
|
||||
{"chart": "Outgoing Bills (Sales Invoice)"},
|
||||
{"chart": "Incoming Bills (Purchase Invoice)"},
|
||||
{"chart": "Bank Balance"},
|
||||
{"chart": "Income"},
|
||||
{"chart": "Expenses"},
|
||||
{"chart": "Patient Appointments"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"doctype": "Dashboard",
|
||||
"dashboard_name": "Project",
|
||||
"charts": [
|
||||
{ "chart": "Project Summary", "width": "Full" }
|
||||
]
|
||||
"charts": [{"chart": "Project Summary", "width": "Full"}],
|
||||
},
|
||||
],
|
||||
"Charts": [
|
||||
@@ -54,7 +53,7 @@ def get_default_dashboards():
|
||||
"timeseries": 1,
|
||||
"owner": "Administrator",
|
||||
"type": "Line",
|
||||
"width": "Half"
|
||||
"width": "Half",
|
||||
},
|
||||
{
|
||||
"doctype": "Dashboard Chart",
|
||||
@@ -68,7 +67,7 @@ def get_default_dashboards():
|
||||
"timeseries": 1,
|
||||
"owner": "Administrator",
|
||||
"type": "Line",
|
||||
"width": "Half"
|
||||
"width": "Half",
|
||||
},
|
||||
{
|
||||
"doctype": "Dashboard Chart",
|
||||
@@ -82,7 +81,7 @@ def get_default_dashboards():
|
||||
"timeseries": 1,
|
||||
"owner": "Administrator",
|
||||
"type": "Line",
|
||||
"width": "Half"
|
||||
"width": "Half",
|
||||
},
|
||||
{
|
||||
"doctype": "Dashboard Chart",
|
||||
@@ -98,7 +97,7 @@ def get_default_dashboards():
|
||||
"owner": "Administrator",
|
||||
"document_type": "Purchase Invoice",
|
||||
"type": "Bar",
|
||||
"width": "Half"
|
||||
"width": "Half",
|
||||
},
|
||||
{
|
||||
"doctype": "Dashboard Chart",
|
||||
@@ -114,18 +113,18 @@ def get_default_dashboards():
|
||||
"owner": "Administrator",
|
||||
"document_type": "Sales Invoice",
|
||||
"type": "Bar",
|
||||
"width": "Half"
|
||||
"width": "Half",
|
||||
},
|
||||
{
|
||||
'doctype': 'Dashboard Chart',
|
||||
'name': 'Project Summary',
|
||||
'chart_name': 'Project Summary',
|
||||
'chart_type': 'Report',
|
||||
'report_name': 'Project Summary',
|
||||
'is_public': 1,
|
||||
'filters_json': json.dumps({"company": company.name, "status": "Open"}),
|
||||
'type': 'Bar',
|
||||
'custom_options': '{"type": "bar", "colors": ["#fc4f51", "#78d6ff", "#7575ff"], "axisOptions": { "shortenYAxisNumbers": 1}, "barOptions": { "stacked": 1 }}',
|
||||
"doctype": "Dashboard Chart",
|
||||
"name": "Project Summary",
|
||||
"chart_name": "Project Summary",
|
||||
"chart_type": "Report",
|
||||
"report_name": "Project Summary",
|
||||
"is_public": 1,
|
||||
"filters_json": json.dumps({"company": company.name, "status": "Open"}),
|
||||
"type": "Bar",
|
||||
"custom_options": '{"type": "bar", "colors": ["#fc4f51", "#78d6ff", "#7575ff"], "axisOptions": { "shortenYAxisNumbers": 1}, "barOptions": { "stacked": 1 }}',
|
||||
},
|
||||
{
|
||||
"doctype": "Dashboard Chart",
|
||||
@@ -140,11 +139,12 @@ def get_default_dashboards():
|
||||
"owner": "Administrator",
|
||||
"document_type": "Patient Appointment",
|
||||
"type": "Line",
|
||||
"width": "Half"
|
||||
}
|
||||
]
|
||||
"width": "Half",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def get_account(account_type, company):
|
||||
accounts = frappe.get_list("Account", filters={"account_type": account_type, "company": company})
|
||||
if accounts:
|
||||
|
||||
Reference in New Issue
Block a user