From 631260b632f01b5b0b16e7fd61a7fd1b40bd562f Mon Sep 17 00:00:00 2001 From: marination Date: Wed, 6 May 2020 18:12:26 +0530 Subject: [PATCH] chore: Added fixtures and Onboarding. --- erpnext/buying/desk_page/buying/buying.json | 6 +- erpnext/buying/onboarding/buying/buying.json | 42 +++++++++ .../buying_settings/buying_settings.json | 16 ++++ .../create_a_supplier/create_a_supplier.json | 16 ++++ .../introduction_to_buying.json | 16 ++++ .../setup_wizard/data/dashboard_charts.py | 93 +++++++++++++++++++ 6 files changed, 187 insertions(+), 2 deletions(-) create mode 100644 erpnext/buying/onboarding/buying/buying.json create mode 100644 erpnext/buying/onboarding_step/buying_settings/buying_settings.json create mode 100644 erpnext/buying/onboarding_step/create_a_supplier/create_a_supplier.json create mode 100644 erpnext/buying/onboarding_step/introduction_to_buying/introduction_to_buying.json diff --git a/erpnext/buying/desk_page/buying/buying.json b/erpnext/buying/desk_page/buying/buying.json index 432f3c557b..9749f3c97f 100644 --- a/erpnext/buying/desk_page/buying/buying.json +++ b/erpnext/buying/desk_page/buying/buying.json @@ -54,10 +54,11 @@ "idx": 0, "is_standard": 1, "label": "Buying", - "modified": "2020-05-05 23:48:25.788598", + "modified": "2020-05-06 18:10:12.760321", "modified_by": "Administrator", "module": "Buying", "name": "Buying", + "onboarding": "Buying", "owner": "Administrator", "pin_to_bottom": 0, "pin_to_top": 0, @@ -107,5 +108,6 @@ "link_to": "Item-wise Purchase Register", "type": "Report" } - ] + ], + "shortcuts_label": "Quick Access" } \ No newline at end of file diff --git a/erpnext/buying/onboarding/buying/buying.json b/erpnext/buying/onboarding/buying/buying.json new file mode 100644 index 0000000000..c35309964e --- /dev/null +++ b/erpnext/buying/onboarding/buying/buying.json @@ -0,0 +1,42 @@ +{ + "allow_roles": [ + { + "role": "Purchase Manager" + }, + { + "role": "Purchase User" + }, + { + "role": "Stock Manager" + }, + { + "role": "Stock User" + } + ], + "creation": "2020-05-06 15:56:35.049205", + "docstatus": 0, + "doctype": "Onboarding", + "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/buying", + "idx": 0, + "is_complete": 0, + "modified": "2020-05-06 16:49:17.433261", + "modified_by": "Administrator", + "module": "Buying", + "name": "Buying", + "owner": "Administrator", + "steps": [ + { + "step": "Introduction to Buying" + }, + { + "step": "Create a Supplier" + }, + { + "step": "Buying Settings" + } + ], + "subtitle": "Products, Purchases, Analysis and more.", + "success_message": "The Buying Module is all set up!", + "title": "Let's Setup the Buying Module.", + "user_can_dismiss": 1 +} \ No newline at end of file diff --git a/erpnext/buying/onboarding_step/buying_settings/buying_settings.json b/erpnext/buying/onboarding_step/buying_settings/buying_settings.json new file mode 100644 index 0000000000..7274c0d62d --- /dev/null +++ b/erpnext/buying/onboarding_step/buying_settings/buying_settings.json @@ -0,0 +1,16 @@ +{ + "action": "Update Settings", + "creation": "2020-05-06 15:53:44.667414", + "docstatus": 0, + "doctype": "Onboarding Step", + "idx": 0, + "is_complete": 0, + "is_mandatory": 0, + "is_skipped": 0, + "modified": "2020-05-06 16:51:56.862206", + "modified_by": "Administrator", + "name": "Buying Settings", + "owner": "Administrator", + "reference_document": "Buying Settings", + "title": "Configure Buying Settings." +} \ No newline at end of file diff --git a/erpnext/buying/onboarding_step/create_a_supplier/create_a_supplier.json b/erpnext/buying/onboarding_step/create_a_supplier/create_a_supplier.json new file mode 100644 index 0000000000..14164c3303 --- /dev/null +++ b/erpnext/buying/onboarding_step/create_a_supplier/create_a_supplier.json @@ -0,0 +1,16 @@ +{ + "action": "Create Entry", + "creation": "2020-05-06 15:46:09.019329", + "docstatus": 0, + "doctype": "Onboarding Step", + "idx": 0, + "is_complete": 0, + "is_mandatory": 1, + "is_skipped": 0, + "modified": "2020-05-06 17:00:41.446942", + "modified_by": "Administrator", + "name": "Create a Supplier", + "owner": "Administrator", + "reference_document": "Supplier", + "title": "Create a Supplier" +} \ No newline at end of file diff --git a/erpnext/buying/onboarding_step/introduction_to_buying/introduction_to_buying.json b/erpnext/buying/onboarding_step/introduction_to_buying/introduction_to_buying.json new file mode 100644 index 0000000000..f1a027af36 --- /dev/null +++ b/erpnext/buying/onboarding_step/introduction_to_buying/introduction_to_buying.json @@ -0,0 +1,16 @@ +{ + "action": "Watch Video", + "creation": "2020-05-06 15:37:09.477765", + "docstatus": 0, + "doctype": "Onboarding Step", + "idx": 0, + "is_complete": 0, + "is_mandatory": 0, + "is_skipped": 0, + "modified": "2020-05-06 16:47:47.378049", + "modified_by": "Administrator", + "name": "Introduction to Buying", + "owner": "Administrator", + "title": "Introduction to Buying", + "video_url": "https://youtu.be/efFajTTQBa8" +} \ No newline at end of file diff --git a/erpnext/setup/setup_wizard/data/dashboard_charts.py b/erpnext/setup/setup_wizard/data/dashboard_charts.py index b182dfc103..8d29397390 100644 --- a/erpnext/setup/setup_wizard/data/dashboard_charts.py +++ b/erpnext/setup/setup_wizard/data/dashboard_charts.py @@ -32,6 +32,17 @@ def get_default_dashboards(): { "chart": "Expenses" }, { "chart": "Patient Appointments" } ] + }, + { + "doctype": "Dashboard", + "dashboard_name": "Buying", + "charts": [ + { "chart": "Purchase Analytics" }, + { "chart": "Material Request Purchase Analysis" }, + { "chart": "Purchase Order Analysis" }, + { "chart": "Requested Items to Order" }, + ] + } ], "Charts": [ @@ -123,6 +134,88 @@ 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": "Line", + "y_axis_fields": [{"idx": 1, "__islocal": "true", "y_field": "total"}], + "y_fields": ["total"], + "lineOptions": {"regionFill": 1} + }) + }, + { + "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} + }) } ] }