From e7900b24a0563a275da266542f314c2f2af4416f Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 2 Mar 2017 11:13:18 +0530 Subject: [PATCH 1/3] [minor] add progress in desktop help message --- erpnext/utilities/activation.py | 162 +++++++++++++++++--------------- 1 file changed, 88 insertions(+), 74 deletions(-) diff --git a/erpnext/utilities/activation.py b/erpnext/utilities/activation.py index baede31537..0f965bc5dd 100644 --- a/erpnext/utilities/activation.py +++ b/erpnext/utilities/activation.py @@ -51,87 +51,101 @@ def get_level(): def get_help_messages(): '''Returns help messages to be shown on Desktop''' - if get_level() > 6: - return [] + # if get_level() > 6: + # return [] messages = [] domain = frappe.db.get_value('Company', erpnext.get_default_company(), 'domain') - if domain in ('Manufacturing', 'Retail', 'Services', 'Distribution'): - count = frappe.db.count('Lead') - if count < 3: - messages.append(dict( - title=_('Create Leads'), - description=_('Leads help you get business, add all your contacts and more as your leads'), - action=_('Make Lead'), - route='List/Lead', - count=count - )) - - count = frappe.db.count('Quotation') - if count < 3: - messages.append(dict( - title=_('Create customer quotes'), - description=_('Quotations are proposals, bids you have sent to your customers'), - action=_('Make Quotation'), - route='List/Quotation' - )) - - count = frappe.db.count('Sales Order') - if count < 3: - messages.append(dict( - title=_('Manage your orders'), - description=_('Make Sales Orders to help you plan your work and deliver on-time'), - action=_('Make Sales Order'), - route='List/Sales Order' - )) - - count = frappe.db.count('Purchase Order') - if count < 3: - messages.append(dict( - title=_('Create Purchase Orders'), - description=_('Purchase orders help you plan and follow up on your purchases'), - action=_('Make Purchase Order'), - route='List/Purchase Order' - )) - - count = frappe.db.count('User') - if count < 3: - messages.append(dict( - 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=_('Make User'), - route='List/User' - )) - - elif domain == 'Education': - count = frappe.db.count('Student') - if count < 5: - messages.append(dict( - title=_('Add Students'), - description=_('Students are at the heart of the system, add all your students'), - action=_('Make Student'), - route='List/Student' - )) - - count = frappe.db.count('Student Batch') - if count < 3: - messages.append(dict( - title=_('Group your students in batches'), - description=_('Student Batches help you track attendance, assessments and fees for students'), - action=_('Make Student Batch'), - route='List/Student Batch' - )) - - # anyways - count = frappe.db.count('Employee') - if count < 3: - messages.append(dict( + 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=_('Make 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=_('Make Quotation'), + route='List/Quotation', + domain=('Manufacturing', 'Retail', 'Services', 'Distribution'), + target=30 + ), + frappe._dict( + doctype='Sales Order', + title=_('Manage your orders'), + description=_('Make Sales Orders to help you plan your work and deliver on-time'), + action=_('Make 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=_('Make 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=_('Make 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=_('Make 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=_('Make 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=_('Make 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=_('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 From 7067ff026ad4078213d4f53c71326d8ef5b82e47 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 2 Mar 2017 11:14:09 +0530 Subject: [PATCH 2/3] [minor] add progress in desktop help message --- erpnext/utilities/activation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/utilities/activation.py b/erpnext/utilities/activation.py index 0f965bc5dd..c4841bb619 100644 --- a/erpnext/utilities/activation.py +++ b/erpnext/utilities/activation.py @@ -51,8 +51,8 @@ def get_level(): def get_help_messages(): '''Returns help messages to be shown on Desktop''' - # if get_level() > 6: - # return [] + if get_level() > 6: + return [] messages = [] @@ -75,7 +75,7 @@ def get_help_messages(): action=_('Make Quotation'), route='List/Quotation', domain=('Manufacturing', 'Retail', 'Services', 'Distribution'), - target=30 + target=3 ), frappe._dict( doctype='Sales Order', From 1cc7024cb4075017fc5a74eb37176d0987de18ec Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 2 Mar 2017 13:08:14 +0600 Subject: [PATCH 3/3] bumped to version 7.2.27 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 1fc2cbddc1..86c0760d8b 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.2.26' +__version__ = '7.2.27' def get_default_company(user=None): '''Get default company for user'''