style: format code with black
This commit is contained in:
@@ -41,7 +41,7 @@ def get_level():
|
||||
"Supplier": 5,
|
||||
"Task": 5,
|
||||
"User": 5,
|
||||
"Work Order": 5
|
||||
"Work Order": 5,
|
||||
}
|
||||
|
||||
for doctype, min_count in doctypes.items():
|
||||
@@ -50,111 +50,118 @@ def get_level():
|
||||
activation_level += 1
|
||||
sales_data.append({doctype: count})
|
||||
|
||||
if frappe.db.get_single_value('System Settings', 'setup_complete'):
|
||||
if frappe.db.get_single_value("System Settings", "setup_complete"):
|
||||
activation_level += 1
|
||||
|
||||
communication_number = frappe.db.count('Communication', dict(communication_medium='Email'))
|
||||
communication_number = frappe.db.count("Communication", dict(communication_medium="Email"))
|
||||
if communication_number > 10:
|
||||
activation_level += 1
|
||||
sales_data.append({"Communication": communication_number})
|
||||
|
||||
# recent login
|
||||
if frappe.db.sql('select name from tabUser where last_login > date_sub(now(), interval 2 day) limit 1'):
|
||||
if frappe.db.sql(
|
||||
"select name from tabUser where last_login > date_sub(now(), interval 2 day) limit 1"
|
||||
):
|
||||
activation_level += 1
|
||||
|
||||
level = {"activation_level": activation_level, "sales_data": sales_data}
|
||||
|
||||
return level
|
||||
|
||||
|
||||
def get_help_messages():
|
||||
'''Returns help messages to be shown on Desktop'''
|
||||
"""Returns help messages to be shown on Desktop"""
|
||||
if get_level() > 6:
|
||||
return []
|
||||
|
||||
domain = frappe.get_cached_value('Company', erpnext.get_default_company(), 'domain')
|
||||
domain = frappe.get_cached_value("Company", erpnext.get_default_company(), "domain")
|
||||
messages = []
|
||||
|
||||
message_settings = [
|
||||
frappe._dict(
|
||||
doctype='Lead',
|
||||
title=_('Create Leads'),
|
||||
description=_('Leads help you get business, add all your contacts and more as your leads'),
|
||||
action=_('Create Lead'),
|
||||
route='List/Lead',
|
||||
domain=('Manufacturing', 'Retail', 'Services', 'Distribution'),
|
||||
target=3
|
||||
doctype="Lead",
|
||||
title=_("Create Leads"),
|
||||
description=_("Leads help you get business, add all your contacts and more as your leads"),
|
||||
action=_("Create Lead"),
|
||||
route="List/Lead",
|
||||
domain=("Manufacturing", "Retail", "Services", "Distribution"),
|
||||
target=3,
|
||||
),
|
||||
frappe._dict(
|
||||
doctype='Quotation',
|
||||
title=_('Create customer quotes'),
|
||||
description=_('Quotations are proposals, bids you have sent to your customers'),
|
||||
action=_('Create Quotation'),
|
||||
route='List/Quotation',
|
||||
domain=('Manufacturing', 'Retail', 'Services', 'Distribution'),
|
||||
target=3
|
||||
doctype="Quotation",
|
||||
title=_("Create customer quotes"),
|
||||
description=_("Quotations are proposals, bids you have sent to your customers"),
|
||||
action=_("Create Quotation"),
|
||||
route="List/Quotation",
|
||||
domain=("Manufacturing", "Retail", "Services", "Distribution"),
|
||||
target=3,
|
||||
),
|
||||
frappe._dict(
|
||||
doctype='Sales Order',
|
||||
title=_('Manage your orders'),
|
||||
description=_('Create Sales Orders to help you plan your work and deliver on-time'),
|
||||
action=_('Create Sales Order'),
|
||||
route='List/Sales Order',
|
||||
domain=('Manufacturing', 'Retail', 'Services', 'Distribution'),
|
||||
target=3
|
||||
doctype="Sales Order",
|
||||
title=_("Manage your orders"),
|
||||
description=_("Create Sales Orders to help you plan your work and deliver on-time"),
|
||||
action=_("Create Sales Order"),
|
||||
route="List/Sales Order",
|
||||
domain=("Manufacturing", "Retail", "Services", "Distribution"),
|
||||
target=3,
|
||||
),
|
||||
frappe._dict(
|
||||
doctype='Purchase Order',
|
||||
title=_('Create Purchase Orders'),
|
||||
description=_('Purchase orders help you plan and follow up on your purchases'),
|
||||
action=_('Create Purchase Order'),
|
||||
route='List/Purchase Order',
|
||||
domain=('Manufacturing', 'Retail', 'Services', 'Distribution'),
|
||||
target=3
|
||||
doctype="Purchase Order",
|
||||
title=_("Create Purchase Orders"),
|
||||
description=_("Purchase orders help you plan and follow up on your purchases"),
|
||||
action=_("Create Purchase Order"),
|
||||
route="List/Purchase Order",
|
||||
domain=("Manufacturing", "Retail", "Services", "Distribution"),
|
||||
target=3,
|
||||
),
|
||||
frappe._dict(
|
||||
doctype='User',
|
||||
title=_('Create Users'),
|
||||
description=_('Add the rest of your organization as your users. You can also add invite Customers to your portal by adding them from Contacts'),
|
||||
action=_('Create User'),
|
||||
route='List/User',
|
||||
domain=('Manufacturing', 'Retail', 'Services', 'Distribution'),
|
||||
target=3
|
||||
doctype="User",
|
||||
title=_("Create Users"),
|
||||
description=_(
|
||||
"Add the rest of your organization as your users. You can also add invite Customers to your portal by adding them from Contacts"
|
||||
),
|
||||
action=_("Create User"),
|
||||
route="List/User",
|
||||
domain=("Manufacturing", "Retail", "Services", "Distribution"),
|
||||
target=3,
|
||||
),
|
||||
frappe._dict(
|
||||
doctype='Timesheet',
|
||||
title=_('Add Timesheets'),
|
||||
description=_('Timesheets help keep track of time, cost and billing for activites done by your team'),
|
||||
action=_('Create Timesheet'),
|
||||
route='List/Timesheet',
|
||||
domain=('Services',),
|
||||
target=5
|
||||
doctype="Timesheet",
|
||||
title=_("Add Timesheets"),
|
||||
description=_(
|
||||
"Timesheets help keep track of time, cost and billing for activites done by your team"
|
||||
),
|
||||
action=_("Create Timesheet"),
|
||||
route="List/Timesheet",
|
||||
domain=("Services",),
|
||||
target=5,
|
||||
),
|
||||
frappe._dict(
|
||||
doctype='Student',
|
||||
title=_('Add Students'),
|
||||
description=_('Students are at the heart of the system, add all your students'),
|
||||
action=_('Create Student'),
|
||||
route='List/Student',
|
||||
domain=('Education',),
|
||||
target=5
|
||||
doctype="Student",
|
||||
title=_("Add Students"),
|
||||
description=_("Students are at the heart of the system, add all your students"),
|
||||
action=_("Create Student"),
|
||||
route="List/Student",
|
||||
domain=("Education",),
|
||||
target=5,
|
||||
),
|
||||
frappe._dict(
|
||||
doctype='Student Batch',
|
||||
title=_('Group your students in batches'),
|
||||
description=_('Student Batches help you track attendance, assessments and fees for students'),
|
||||
action=_('Create Student Batch'),
|
||||
route='List/Student Batch',
|
||||
domain=('Education',),
|
||||
target=3
|
||||
doctype="Student Batch",
|
||||
title=_("Group your students in batches"),
|
||||
description=_("Student Batches help you track attendance, assessments and fees for students"),
|
||||
action=_("Create Student Batch"),
|
||||
route="List/Student Batch",
|
||||
domain=("Education",),
|
||||
target=3,
|
||||
),
|
||||
frappe._dict(
|
||||
doctype='Employee',
|
||||
title=_('Create Employee Records'),
|
||||
description=_('Create Employee records to manage leaves, expense claims and payroll'),
|
||||
action=_('Create Employee'),
|
||||
route='List/Employee',
|
||||
target=3
|
||||
)
|
||||
doctype="Employee",
|
||||
title=_("Create Employee Records"),
|
||||
description=_("Create Employee records to manage leaves, expense claims and payroll"),
|
||||
action=_("Create Employee"),
|
||||
route="List/Employee",
|
||||
target=3,
|
||||
),
|
||||
]
|
||||
|
||||
for m in message_settings:
|
||||
|
||||
Reference in New Issue
Block a user