2017-09-04 05:44:04 +00:00
|
|
|
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
import frappe
|
|
|
|
from frappe import _
|
|
|
|
|
|
|
|
def execute():
|
|
|
|
"""Add setup progress actions"""
|
|
|
|
frappe.reload_doc("setup", "doctype", "setup_progress")
|
|
|
|
frappe.reload_doc("setup", "doctype", "setup_progress_action")
|
|
|
|
|
|
|
|
actions = [
|
2017-09-26 07:37:24 +00:00
|
|
|
{"action_name": "Add Company", "action_doctype": "Company", "min_doc_count": 1, "is_completed": 1,
|
2017-09-04 05:44:04 +00:00
|
|
|
"domains": '[]' },
|
2017-09-26 07:37:24 +00:00
|
|
|
{"action_name": "Set Sales Target", "action_doctype": "Company", "min_doc_count": 99,
|
2017-09-13 13:11:01 +00:00
|
|
|
"action_document": frappe.defaults.get_defaults().get("company") or '',
|
|
|
|
"action_field": "monthly_sales_target", "is_completed": 0,
|
|
|
|
"domains": '["Manufacturing", "Services", "Retail", "Distribution"]' },
|
2017-09-26 07:37:24 +00:00
|
|
|
{"action_name": "Add Customers", "action_doctype": "Customer", "min_doc_count": 1, "is_completed": 0,
|
2017-09-04 05:44:04 +00:00
|
|
|
"domains": '["Manufacturing", "Services", "Retail", "Distribution"]' },
|
2017-09-26 07:37:24 +00:00
|
|
|
{"action_name": "Add Suppliers", "action_doctype": "Supplier", "min_doc_count": 1, "is_completed": 0,
|
2017-09-04 05:44:04 +00:00
|
|
|
"domains": '["Manufacturing", "Services", "Retail", "Distribution"]' },
|
2017-09-26 07:37:24 +00:00
|
|
|
{"action_name": "Add Products", "action_doctype": "Item", "min_doc_count": 1, "is_completed": 0,
|
2017-09-04 05:44:04 +00:00
|
|
|
"domains": '["Manufacturing", "Services", "Retail", "Distribution"]' },
|
2017-09-26 07:37:24 +00:00
|
|
|
{"action_name": "Add Programs", "action_doctype": "Program", "min_doc_count": 1, "is_completed": 0,
|
2017-09-04 05:44:04 +00:00
|
|
|
"domains": '["Education"]' },
|
2017-09-26 07:37:24 +00:00
|
|
|
{"action_name": "Add Instructors", "action_doctype": "Instructor", "min_doc_count": 1, "is_completed": 0,
|
2017-09-04 05:44:04 +00:00
|
|
|
"domains": '["Education"]' },
|
2017-09-26 07:37:24 +00:00
|
|
|
{"action_name": "Add Courses", "action_doctype": "Course", "min_doc_count": 1, "is_completed": 0,
|
2017-09-04 05:44:04 +00:00
|
|
|
"domains": '["Education"]' },
|
2017-09-26 07:37:24 +00:00
|
|
|
{"action_name": "Add Rooms", "action_doctype": "Room", "min_doc_count": 1, "is_completed": 0,
|
2017-09-04 05:44:04 +00:00
|
|
|
"domains": '["Education"]' },
|
2017-09-26 07:37:24 +00:00
|
|
|
{"action_name": "Add Users", "action_doctype": "User", "min_doc_count": 4, "is_completed": 0,
|
2017-09-04 05:44:04 +00:00
|
|
|
"domains": '[]' }
|
|
|
|
]
|
|
|
|
|
|
|
|
setup_progress = frappe.get_doc("Setup Progress", "Setup Progress")
|
2017-09-13 13:11:01 +00:00
|
|
|
setup_progress.actions = []
|
2017-09-04 05:44:04 +00:00
|
|
|
for action in actions:
|
|
|
|
setup_progress.append("actions", action)
|
|
|
|
|
|
|
|
setup_progress.save(ignore_permissions=True)
|
|
|
|
|