Merge branch 'hotfix'

This commit is contained in:
Nabin Hait 2017-03-02 12:38:14 +05:30
commit c99f85d84c
2 changed files with 87 additions and 73 deletions

View File

@ -2,7 +2,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
__version__ = '7.2.26' __version__ = '7.2.27'
def get_default_company(user=None): def get_default_company(user=None):
'''Get default company for user''' '''Get default company for user'''

View File

@ -58,80 +58,94 @@ def get_help_messages():
domain = frappe.db.get_value('Company', erpnext.get_default_company(), 'domain') domain = frappe.db.get_value('Company', erpnext.get_default_company(), 'domain')
if domain in ('Manufacturing', 'Retail', 'Services', 'Distribution'): message_settings = [
count = frappe.db.count('Lead') frappe._dict(
if count < 3: doctype='Lead',
messages.append(dict( title=_('Create Leads'),
title=_('Create Leads'), description=_('Leads help you get business, add all your contacts and more as your leads'),
description=_('Leads help you get business, add all your contacts and more as your leads'), action=_('Make Lead'),
action=_('Make Lead'), route='List/Lead',
route='List/Lead', domain=('Manufacturing', 'Retail', 'Services', 'Distribution'),
count=count target=3
)) ),
frappe._dict(
count = frappe.db.count('Quotation') doctype='Quotation',
if count < 3: title=_('Create customer quotes'),
messages.append(dict( description=_('Quotations are proposals, bids you have sent to your customers'),
title=_('Create customer quotes'), action=_('Make Quotation'),
description=_('Quotations are proposals, bids you have sent to your customers'), route='List/Quotation',
action=_('Make Quotation'), domain=('Manufacturing', 'Retail', 'Services', 'Distribution'),
route='List/Quotation' target=3
)) ),
frappe._dict(
count = frappe.db.count('Sales Order') doctype='Sales Order',
if count < 3: title=_('Manage your orders'),
messages.append(dict( description=_('Make Sales Orders to help you plan your work and deliver on-time'),
title=_('Manage your orders'), action=_('Make Sales Order'),
description=_('Make Sales Orders to help you plan your work and deliver on-time'), route='List/Sales Order',
action=_('Make Sales Order'), domain=('Manufacturing', 'Retail', 'Services', 'Distribution'),
route='List/Sales Order' target=3
)) ),
frappe._dict(
count = frappe.db.count('Purchase Order') doctype='Purchase Order',
if count < 3: title=_('Create Purchase Orders'),
messages.append(dict( description=_('Purchase orders help you plan and follow up on your purchases'),
title=_('Create Purchase Orders'), action=_('Make Purchase Order'),
description=_('Purchase orders help you plan and follow up on your purchases'), route='List/Purchase Order',
action=_('Make Purchase Order'), domain=('Manufacturing', 'Retail', 'Services', 'Distribution'),
route='List/Purchase Order' target=3
)) ),
frappe._dict(
count = frappe.db.count('User') doctype='User',
if count < 3: title=_('Create Users'),
messages.append(dict( description=_('Add the rest of your organization as your users. You can also add invite Customers to your portal by adding them from Contacts'),
title=_('Create Users'), action=_('Make User'),
description=_('Add the rest of your organization as your users. You can also add invite Customers to your portal by adding them from Contacts'), route='List/User',
action=_('Make User'), domain=('Manufacturing', 'Retail', 'Services', 'Distribution'),
route='List/User' target=3
)) ),
frappe._dict(
elif domain == 'Education': doctype='Timesheet',
count = frappe.db.count('Student') title=_('Add Timesheets'),
if count < 5: description=_('Timesheets help keep track of time, cost and billing for activites done by your team'),
messages.append(dict( action=_('Make Timesheet'),
title=_('Add Students'), route='List/Timesheet',
description=_('Students are at the heart of the system, add all your students'), domain=('Services',),
action=_('Make Student'), target=5
route='List/Student' ),
)) frappe._dict(
doctype='Student',
count = frappe.db.count('Student Batch') title=_('Add Students'),
if count < 3: description=_('Students are at the heart of the system, add all your students'),
messages.append(dict( action=_('Make Student'),
title=_('Group your students in batches'), route='List/Student',
description=_('Student Batches help you track attendance, assessments and fees for students'), domain=('Education',),
action=_('Make Student Batch'), target=5
route='List/Student Batch' ),
)) frappe._dict(
doctype='Student Batch',
# anyways title=_('Group your students in batches'),
count = frappe.db.count('Employee') description=_('Student Batches help you track attendance, assessments and fees for students'),
if count < 3: action=_('Make Student Batch'),
messages.append(dict( route='List/Student Batch',
domain=('Education',),
target=3
),
frappe._dict(
doctype='Employee',
title=_('Create Employee Records'), title=_('Create Employee Records'),
description=_('Create Employee records to manage leaves, expense claims and payroll'), description=_('Create Employee records to manage leaves, expense claims and payroll'),
action=_('Make Employee'), action=_('Make Employee'),
route='List/Employee' route='List/Employee',
)) target=3
)
]
for m in message_settings:
if not m.domain or domain in m.domain:
m.count = frappe.db.count(m.doctype)
if m.count < m.target:
messages.append(m)
return messages return messages