[sample] add help for sample tasks and make them into notifications
diff --git a/erpnext/setup/setup_wizard/domainify.py b/erpnext/setup/setup_wizard/domainify.py
index 14e2f33..f6f8def 100644
--- a/erpnext/setup/setup_wizard/domainify.py
+++ b/erpnext/setup/setup_wizard/domainify.py
@@ -22,8 +22,8 @@
},
'Retail': {
- 'desktop_icons': ['POS', 'Item', 'Customer', 'Sales Invoice', 'Purchase Order', 'Warranty Claim',
- 'Accounts', 'Buying', 'ToDo'],
+ 'desktop_icons': ['POS', 'Item', 'Customer', 'Sales Invoice', 'Purchase Order',
+ 'Warranty Claim', 'Accounts', 'Task', 'Buying', 'ToDo'],
'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Academics User'],
'properties': [
{'doctype': 'Item', 'fieldname': 'manufacturing', 'property': 'hidden', 'value': 1},
@@ -36,7 +36,7 @@
},
'Distribution': {
- 'desktop_icons': ['Item', 'Customer', 'Supplier', 'Lead', 'Sales Order',
+ 'desktop_icons': ['Item', 'Customer', 'Supplier', 'Lead', 'Sales Order', 'Task',
'Sales Invoice', 'CRM', 'Selling', 'Buying', 'Stock', 'Accounts', 'HR', 'ToDo'],
'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Academics User'],
'set_value': [
@@ -46,8 +46,8 @@
},
'Services': {
- 'desktop_icons': ['Project', 'Timesheet', 'Customer', 'Sales Order', 'Sales Invoice', 'Lead', 'Opportunity',
- 'Expense Claim', 'Employee', 'HR', 'ToDo'],
+ 'desktop_icons': ['Project', 'Timesheet', 'Customer', 'Sales Order', 'Sales Invoice',
+ 'Lead', 'Opportunity', 'Task', 'Expense Claim', 'Employee', 'HR', 'ToDo'],
'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Academics User'],
'properties': [
{'doctype': 'Item', 'fieldname': 'is_stock_item', 'property': 'default', 'value': 0},
@@ -59,10 +59,10 @@
},
'Education': {
'desktop_icons': ['Student', 'Program', 'Course', 'Student Group', 'Instructor',
- 'Fees', 'ToDo', 'Schools'],
+ 'Fees', 'Task', 'ToDo', 'Schools'],
'allow_roles': ['Academics User', 'Accounts User', 'Accounts Manager', 'Item Manager',
'Website Manager', 'HR User', 'HR Manager', 'Purchase User', 'Purchase Manager',
- 'Student'],
+ 'Student', 'Projects User'],
'default_portal_role': 'Student'
},
}
diff --git a/erpnext/setup/setup_wizard/sample_data.py b/erpnext/setup/setup_wizard/sample_data.py
index 955f663..40b4f2e 100644
--- a/erpnext/setup/setup_wizard/sample_data.py
+++ b/erpnext/setup/setup_wizard/sample_data.py
@@ -6,9 +6,11 @@
import frappe
from frappe.utils.make_random import add_random_children
import frappe.utils
-import random
+import random, os, json
+from frappe import _
+from markdown2 import markdown
-def make_sample_data():
+def make_sample_data(args):
"""Create a few opportunities, quotes, material requests, issues, todos, projects
to help the user get started"""
items = frappe.get_all("Item", {'is_sales_item': 1})
@@ -22,7 +24,8 @@
make_opportunity(items, customer)
make_quote(items, customer)
- make_projects()
+ make_projects(args.get('domain'))
+ import_email_alert()
if items and warehouses:
make_material_request(frappe.get_all("Item"))
@@ -84,42 +87,99 @@
def make_issue():
pass
-def make_projects():
+def make_projects(domain):
+ current_date = frappe.utils.nowdate()
project = frappe.get_doc({
"doctype": "Project",
"project_name": "ERPNext Implementation",
})
- current_date = frappe.utils.nowdate()
- project.set("tasks", [
+
+ tasks = [
+ {
+ "title": "Explore ERPNext",
+ "start_date": current_date,
+ "end_date": current_date,
+ "file": "explore.md"
+ }]
+
+ if domain == 'Education':
+ tasks += [
{
- "title": "Explore ERPNext",
- "start_date": frappe.utils.add_days(current_date, 1),
- "end_date": frappe.utils.add_days(current_date, 2)
+ "title": _("Setup Master Data"),
+ "start_date": current_date,
+ "end_date": frappe.utils.add_days(current_date, 1),
+ "file": "school_masters.md"
},
{
- "title": "Run Sales Cycle",
- "start_date": frappe.utils.add_days(current_date, 2),
- "end_date": frappe.utils.add_days(current_date, 3)
+ "title": _("Manage Operations"),
+ "start_date": current_date,
+ "end_date": frappe.utils.add_days(current_date, 2),
+ "file": "school_operations.md"
},
{
- "title": "Run Billing Cycle",
- "start_date": frappe.utils.add_days(current_date, 3),
- "end_date": frappe.utils.add_days(current_date, 4)
- },
- {
- "title": "Run Purchase Cycle",
- "start_date": frappe.utils.add_days(current_date, 4),
- "end_date": frappe.utils.add_days(current_date, 5)
- },
- {
- "title": "Import Data",
- "start_date": frappe.utils.add_days(current_date, 5),
- "end_date": frappe.utils.add_days(current_date, 6)
+ "title": _("Import Data"),
+ "start_date": current_date,
+ "end_date": frappe.utils.add_days(current_date, 3),
+ "file": "school_import_data.md"
},
{
"title": "Go Live!",
- "start_date": frappe.utils.add_days(current_date, 6),
- "end_date": frappe.utils.add_days(current_date, 7)
- }])
+ "start_date": current_date,
+ "end_date": frappe.utils.add_days(current_date, 4),
+ "file": "school_go_live.md"
+ }]
+
+ else:
+ tasks += [
+ {
+ "title": "Setup Master Data",
+ "start_date": current_date,
+ "end_date": frappe.utils.add_days(current_date, 1),
+ "file": "masters.md"
+ },
+ {
+ "title": "Try a Sales Cycle",
+ "start_date": current_date,
+ "end_date": frappe.utils.add_days(current_date, 2),
+ "file": "sales.md"
+ },
+ {
+ "title": "Try a Purchase Cycle",
+ "start_date": current_date,
+ "end_date": frappe.utils.add_days(current_date, 3),
+ "file": "purchase.md"
+ },
+ {
+ "title": "Import Data",
+ "start_date": current_date,
+ "end_date": frappe.utils.add_days(current_date, 4),
+ "file": "import_data.md"
+ },
+ {
+ "title": "Go Live!",
+ "start_date": current_date,
+ "end_date": frappe.utils.add_days(current_date, 5),
+ "file": "go_live.md"
+ }]
+
+ for t in tasks:
+ with open (os.path.join(os.path.dirname(__file__), "tasks", t['file'])) as f:
+ t['description'] = markdown(f.read())
+ del t['file']
+
+ project.append('tasks', t)
project.insert(ignore_permissions=True)
+
+def import_email_alert():
+ '''Import email alert for task start'''
+ with open (os.path.join(os.path.dirname(__file__), "tasks/task_alert.json")) as f:
+ email_alert = frappe.get_doc(json.loads(f.read())[0])
+ email_alert.insert()
+
+def test_sample():
+ frappe.db.sql('delete from `tabEmail Alert`')
+ frappe.db.sql('delete from tabProject')
+ frappe.db.sql('delete from tabTask')
+ make_projects('Education')
+ import_email_alert()
\ No newline at end of file
diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py
index 395ea51..41b978c 100644
--- a/erpnext/setup/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/setup_wizard/setup_wizard.py
@@ -60,7 +60,7 @@
if args.get("add_sample_data"):
try:
- make_sample_data()
+ make_sample_data(args)
frappe.clear_cache()
except:
# clear message
diff --git a/erpnext/setup/setup_wizard/tasks/explore.md b/erpnext/setup/setup_wizard/tasks/explore.md
new file mode 100644
index 0000000..eebde47
--- /dev/null
+++ b/erpnext/setup/setup_wizard/tasks/explore.md
@@ -0,0 +1,14 @@
+Thanks for checking this out! β€οΈ
+
+If you are evaluating an ERP system for the first time, this is going to be quite a task! But don't worry, ERPNext is awesome.
+
+First, let's just get familiar with the surroundings. ERPNext covers a *lot of features*, go to the home page and click on the "Explore" icon. Click on all the modules, and make a list of things you want to do.
+
+Whats more, you can also update it here:
+
+Things I like to do in ERPNext
+
+ππππ
+
+1.
+2.
\ No newline at end of file
diff --git a/erpnext/setup/setup_wizard/tasks/go_live.md b/erpnext/setup/setup_wizard/tasks/go_live.md
new file mode 100644
index 0000000..4e5c1d4
--- /dev/null
+++ b/erpnext/setup/setup_wizard/tasks/go_live.md
@@ -0,0 +1,21 @@
+Ready to go live with ERPNext?
+
+So lets be clear,
+
+1. You tried a few cycles in ERPNext
+2. You have imported all your records - your model of your organization is complete.
+3. You can see the Matrix π
+
+Now lets bring the current "state" of your business into ERPNext. For this you need to do a few more things.
+
+Warning: This might be tricky, and you can always do this later and you might need the help of your accountant to help you with this.
+
+1. Sync up your **Chart of Accounts**
+3. Add your opening stock using **Stock Reconciliation**
+4. Add your open invoices (both sales and purchase)
+3. Add your opening account balances by making a **Journal Entry**
+
+You are now set to go! π π
+
+If you need help for going live, sign up for an account at erpnext.com or find a partner to help you with this.
+
diff --git a/erpnext/setup/setup_wizard/tasks/import_data.md b/erpnext/setup/setup_wizard/tasks/import_data.md
new file mode 100644
index 0000000..b5ad91e
--- /dev/null
+++ b/erpnext/setup/setup_wizard/tasks/import_data.md
@@ -0,0 +1,8 @@
+Ready for some real stuff? πͺ Lets import some data!
+
+If you are already running a business, you most likely have your Items, Customers or Suppliers in some spreadsheet file somewhere.
+
+You can quickly get them into ERPNext by using the data import tool. Just type "data import" in the search bar to get started π
+
+If you need help, just head to the user forum https://discuss.erpnext.com
+
diff --git a/erpnext/setup/setup_wizard/tasks/masters.md b/erpnext/setup/setup_wizard/tasks/masters.md
new file mode 100644
index 0000000..2e286de
--- /dev/null
+++ b/erpnext/setup/setup_wizard/tasks/masters.md
@@ -0,0 +1,14 @@
+π‘Tip: Your ERPNext account is a model of your real business π
+
+So what does a business exactly do?
+
+**You sell products (or services) to a customer**
+
+To start building a model of your business, you can start with just 2 things:
+
+1. Customers
+2. Items
+
+Start adding them now!
+
+Hint: type "Item" in the search bar above π
\ No newline at end of file
diff --git a/erpnext/setup/setup_wizard/tasks/purchase.md b/erpnext/setup/setup_wizard/tasks/purchase.md
new file mode 100644
index 0000000..491248d
--- /dev/null
+++ b/erpnext/setup/setup_wizard/tasks/purchase.md
@@ -0,0 +1,13 @@
+Already figured out sales? Nice, now lets get to purchasing stuff.
+
+1. First add a few **Suppliers**
+2. Find out what you need by making **Material Requests**. Think of them as stickies π on your refrigerator.
+3. Now start placing orders via **Purchase Order**.
+4. When your suppliers deliver, make **Purchase Receipts**
+
+Thats it!
+
+If you track inventory on your items, they will automatically be added to your stock.
+
+Now never run out of stock again! π
+
diff --git a/erpnext/setup/setup_wizard/tasks/sales.md b/erpnext/setup/setup_wizard/tasks/sales.md
new file mode 100644
index 0000000..960a988
--- /dev/null
+++ b/erpnext/setup/setup_wizard/tasks/sales.md
@@ -0,0 +1,17 @@
+ERPNext covers most of what you need to start selling. π
+
+Few terms to get familiar with:
+
+1. Potential customers are **Leads**
+2. Deals in pipeline are **Opportunities**
+3. Proposals sent to customers are **Quotations**
+4. Confirmed orders are **Sales Orders**
+5. Fulfilment (shipment or completion of services) is **Delivery Note**
+
+The first thing you should probably do is add 5 leads (contact information about prospects who can give you new business). Hint: just type "Lead" in the search bar on the top π
+
+Find out if they have any need you can help with and make a few "Opportunities"
+
+Then send them proposals with "Quotation". Did you know, you can email them directly from ERPNext! π
+
+See your sales go up up up! π
\ No newline at end of file
diff --git a/erpnext/setup/setup_wizard/tasks/school_go_live.md b/erpnext/setup/setup_wizard/tasks/school_go_live.md
new file mode 100644
index 0000000..e470507
--- /dev/null
+++ b/erpnext/setup/setup_wizard/tasks/school_go_live.md
@@ -0,0 +1,20 @@
+Ready to go live with ERPNext?
+
+So lets be clear,
+
+1. You tried a doing a few things in ERPNext
+2. You have imported all your records - your model of your school is complete.
+3. You can see the Matrix π
+
+Now lets bring the current "state" of your institute into ERPNext -> This includes the standard organization stuff like accounts and inventory management. For this you need to do a few more things.
+
+Warning: This might be tricky, and you can always do this later and you might need the help of your accountant to help you with this.
+
+1. Sync up your **Chart of Accounts**
+3. Add your opening stock using **Stock Reconciliation**
+3. Add your opening account balances by making a **Journal Entry**
+
+You are now set to go! π π
+
+If you need help for going live, sign up for an account at erpnext.com or find a partner to help you with this.
+
diff --git a/erpnext/setup/setup_wizard/tasks/school_import_data.md b/erpnext/setup/setup_wizard/tasks/school_import_data.md
new file mode 100644
index 0000000..9074e9a
--- /dev/null
+++ b/erpnext/setup/setup_wizard/tasks/school_import_data.md
@@ -0,0 +1,8 @@
+Ready for some real stuff? πͺ Lets import some data!
+
+If you are already running a school, you most likely have your Students in some spreadsheet file somewhere.
+
+You can quickly get them into ERPNext by using the data import tool. Just type "data import" in the search bar to get started π
+
+If you need help, just head to the user forum https://discuss.erpnext.com
+
diff --git a/erpnext/setup/setup_wizard/tasks/school_masters.md b/erpnext/setup/setup_wizard/tasks/school_masters.md
new file mode 100644
index 0000000..2e072d1
--- /dev/null
+++ b/erpnext/setup/setup_wizard/tasks/school_masters.md
@@ -0,0 +1,11 @@
+π‘Tip: Your ERPNext account is a model of your school or college π
+
+Lets start making things in ERPNext that are reprentative of your institution.
+
+1. Make a list of **Programs** that you offer
+1. Add a few **Courses** that your programs cover
+1. Create **Academic Terms** and **Academic Years**
+1. Start adding **Students**
+1. Group your students into **Batches**
+
+Now you are ready to run your school. Start by tracking attendance! π
diff --git a/erpnext/setup/setup_wizard/tasks/school_operations.md b/erpnext/setup/setup_wizard/tasks/school_operations.md
new file mode 100644
index 0000000..6b49cd2
--- /dev/null
+++ b/erpnext/setup/setup_wizard/tasks/school_operations.md
@@ -0,0 +1,11 @@
+ERPNext will help you manage your day-to-day operations π
+
+1. Admissions
+1. Attendance
+1. Assessments
+1. Fee collection
+1. Time Table and scheduling
+
+Unless you have a dedicated team to set this up for you, we recommend using student attendance first! For that you need to create Student Batches and Student Groups. What is the difference?
+
+If all your students in a group have the same set of classes (like in a primary school) then you make batches. If your student in a particular program can select their courses, you need to create a Student Group for each course! π©π©π§π§π¨π¨π§π¦
\ No newline at end of file
diff --git a/erpnext/setup/setup_wizard/tasks/task_alert.json b/erpnext/setup/setup_wizard/tasks/task_alert.json
new file mode 100644
index 0000000..9c8462a
--- /dev/null
+++ b/erpnext/setup/setup_wizard/tasks/task_alert.json
@@ -0,0 +1,28 @@
+[
+ {
+ "attach_print": 0,
+ "condition": "doc.status in ('Open', 'Overdue')",
+ "date_changed": "exp_end_date",
+ "days_in_advance": 0,
+ "docstatus": 0,
+ "doctype": "Email Alert",
+ "document_type": "Task",
+ "enabled": 1,
+ "event": "Days After",
+ "is_standard": 0,
+ "message": "<p>Task due today:</p>\n\n<div>\n{{ doc.description }}\n</div>\n\n<hr>\n<p style=\"font-size: 85%\">\nThis is a notification for a task that is due today, and a sample <b>Email Alert</b>. In ERPNext you can setup email alerts on anything, Invoices, Orders, Leads, Opportunities, so you never miss a thing.\n</p>",
+ "method": null,
+ "modified": "2017-03-09 07:34:58.168370",
+ "module": null,
+ "name": "Task Due Alert",
+ "recipients": [
+ {
+ "cc": null,
+ "condition": null,
+ "email_by_document_field": "owner"
+ }
+ ],
+ "subject": "{{ doc.subject }}",
+ "value_changed": null
+ }
+]
\ No newline at end of file
diff --git a/erpnext/startup/notifications.py b/erpnext/startup/notifications.py
index a1b90f9..ee8af02 100644
--- a/erpnext/startup/notifications.py
+++ b/erpnext/startup/notifications.py
@@ -8,7 +8,7 @@
{
"Issue": {"status": "Open"},
"Warranty Claim": {"status": "Open"},
- "Task": {"status": "Overdue"},
+ "Task": {"status": ("in", ("Open", "Overdue"))},
"Project": {"status": "Open"},
"Item": {"total_projected_qty": ("<", 0)},
"Customer": {"status": "Open"},
@@ -23,11 +23,11 @@
},
"Journal Entry": {"docstatus": 0},
"Sales Invoice": {
- "outstanding_amount": (">", 0),
- "docstatus": ("<", 2)
+ "outstanding_amount": (">", 0),
+ "docstatus": ("<", 2)
},
"Purchase Invoice": {
- "outstanding_amount": (">", 0),
+ "outstanding_amount": (">", 0),
"docstatus": ("<", 2)
},
"Payment Entry": {"docstatus": 0},