[sample] add help for sample tasks and make them into notifications

This commit is contained in:
Rushabh Mehta 2017-03-09 18:11:11 +05:30
parent aea1c2a1e3
commit 868bb26e24
15 changed files with 265 additions and 40 deletions

View File

@ -22,8 +22,8 @@ def get_domain(domain):
},
'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 @@ def get_domain(domain):
},
'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 @@ def get_domain(domain):
},
'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 @@ def get_domain(domain):
},
'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'
},
}

View File

@ -6,9 +6,11 @@ from __future__ import unicode_literals
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 @@ def make_sample_data():
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_material_request(items):
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()

View File

@ -60,7 +60,7 @@ def setup_complete(args=None):
if args.get("add_sample_data"):
try:
make_sample_data()
make_sample_data(args)
frappe.clear_cache()
except:
# clear message

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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 🔎

View File

@ -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! 😎

View File

@ -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! 📈

View File

@ -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.

View File

@ -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

View File

@ -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! 🖐

View File

@ -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! 👩‍👩‍👧‍👧👨‍👨‍👧‍👦

View File

@ -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
}
]

View File

@ -8,7 +8,7 @@ def get_notification_config():
{
"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 @@ def get_notification_config():
},
"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},