Compare commits

..

26 Commits

Author SHA1 Message Date
Nabin Hait
c1a5b348b5 Merge branch 'hotfix' 2017-03-15 11:28:06 +05:30
Nabin Hait
1157ee365b bumped to version 7.2.30 2017-03-15 11:58:06 +06:00
Nabin Hait
fd9b2467d6 Merge pull request #7966 from rohitwaghchaure/item_variant_issue_for_nuermic
[Fix] Item variants broken when using naming series for items and vriants of numeric value
2017-03-12 16:34:40 +05:30
Rohit Waghchaure
0169341917 [Fix] Item variants broken when using naming series for items and vriants of numeric value 2017-03-10 19:40:08 +05:30
Nabin Hait
e7e82fe477 Merge pull request #7970 from rmehta/sample-tasks
Descriptions on sample tasks
2017-03-10 14:58:52 +05:30
Rushabh Mehta
83aa5ee3df [messages] cleanup 2017-03-10 12:47:29 +05:30
Rushabh Mehta
868bb26e24 [sample] add help for sample tasks and make them into notifications 2017-03-09 18:11:11 +05:30
Rushabh Mehta
aea1c2a1e3 [minor] allow sales order delivery date before order date 2017-03-09 12:46:51 +05:30
Nabin Hait
89d494fbf5 Merge branch 'hotfix' 2017-03-08 14:30:12 +05:30
Nabin Hait
27c4fdc2df bumped to version 7.2.29 2017-03-08 15:00:12 +06:00
Nabin Hait
804c4fc4a7 Merge pull request #7951 from rohitwaghchaure/purchase_return_issue
[Fix] Purchase return issue
2017-03-08 14:28:55 +05:30
Nabin Hait
842d4fcf53 Merge pull request #7954 from mbauskar/hotfix
removed the test_clear_blank_rows test case from JE
2017-03-08 14:19:04 +05:30
mbauskar
02198ec8b0 removed the test_clear_blank_rows test case from JE 2017-03-08 12:34:36 +05:30
Nabin Hait
40f5d1845f Merge branch 'hotfix' 2017-03-08 11:16:00 +05:30
Nabin Hait
f967206523 bumped to version 7.2.28 2017-03-08 11:46:00 +06:00
Rohit Waghchaure
d05a8737f9 [Fix] Purchase return issue 2017-03-08 10:30:23 +05:30
Nabin Hait
44bc6ab242 Merge pull request #7937 from mbauskar/hotfix
[minor] allowed the credit and debit amount to be 0 in JE
2017-03-07 12:56:02 +05:30
mbauskar
c03f275e7a [minor] allowed the credit and debit amount to be 0 in JE 2017-03-07 11:59:55 +05:30
Nabin Hait
f5a9c8ecf2 Merge pull request #7936 from rohitwaghchaure/financial_statement_issue
Minor fix
2017-03-07 00:27:53 +05:30
Rohit Waghchaure
9f4317e9b8 minor fix 2017-03-06 23:42:45 +05:30
Nabin Hait
9e6e718ee1 Merge pull request #7913 from rohitwaghchaure/minor_fix
Removed fiscal year and month from the print of monthly salary register
2017-03-04 18:30:44 +05:30
Rohit Waghchaure
f8aa6ed46b removed fiscal year and month from the print 2017-03-02 17:51:15 +05:30
Nabin Hait
c99f85d84c Merge branch 'hotfix' 2017-03-02 12:38:14 +05:30
Nabin Hait
1cc7024cb4 bumped to version 7.2.27 2017-03-02 13:08:14 +06:00
Rushabh Mehta
7067ff026a [minor] add progress in desktop help message 2017-03-02 11:14:09 +05:30
Rushabh Mehta
e7900b24a0 [minor] add progress in desktop help message 2017-03-02 11:13:18 +05:30
24 changed files with 287 additions and 147 deletions

View File

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

View File

@@ -37,16 +37,8 @@ class JournalEntry(AccountsController):
self.validate_credit_debit_note()
self.validate_empty_accounts_table()
self.set_account_and_party_balance()
self.clear_zero_debit_credit_row()
if not self.title:
self.title = self.get_title()
def clear_zero_debit_credit_row(self):
self.accounts = [account for account in self.accounts
if not (account.debit_in_account_currency==0.0 and account.credit_in_account_currency==0.0)]
if not self.accounts:
frappe.throw("Debit or Credit amount is not found in account table")
def on_submit(self):
self.check_credit_limit()

View File

@@ -171,20 +171,6 @@ class TestJournalEntry(unittest.TestCase):
})
jv.submit()
def test_clear_blank_rows(self):
je = make_journal_entry("_Test Bank - _TC", "_Test Account Stock Expenses - _TC", 100, save=False)
je.append("accounts", {
"account": "_Test Cash - _TC",
"debit_in_account_currency": 0,
"credit_in_account_currency": 0,
"exchange_rate": 1
})
self.assertEqual(len(je.get("accounts")), 3)
je.save()
self.assertEqual(len(je.get("accounts")), 2)
def make_journal_entry(account1, account2, amount, cost_center=None, posting_date=None, exchange_rate=1, save=True, submit=False, project=None):
if not cost_center:

View File

@@ -141,8 +141,7 @@ def calculate_values(accounts_by_name, gl_entries_by_account, period_list, accum
if entry.posting_date <= period.to_date:
if (accumulated_values or entry.posting_date >= period.from_date) and \
(entry.fiscal_year == period.to_date_fiscal_year or not ignore_accumulated_values_for_fy):
frappe.errprint([entry.fiscal_year, period.to_date_fiscal_year])
(not ignore_accumulated_values_for_fy or entry.fiscal_year == period.to_date_fiscal_year):
d[period.key] = d.get(period.key, 0.0) + flt(entry.debit) - flt(entry.credit)
if entry.posting_date < period_list[0].year_start_date:

View File

@@ -141,7 +141,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
var item = frappe.get_doc(cdt, cdn);
if ((doc.doctype == "Purchase Receipt") || (doc.doctype == "Purchase Invoice" && doc.update_stock)) {
frappe.model.round_floats_in(item, ["qty", "received_qty"]);
if(!(item.received_qty || item.rejected_qty) && item.qty) {
if(!item.rejected_qty && item.qty) {
item.received_qty = item.qty;
}

View File

@@ -169,7 +169,7 @@ def make_variant_item_code(template_item_code, variant):
item_attribute = frappe.db.sql("""select i.numeric_values, v.abbr
from `tabItem Attribute` i left join `tabItem Attribute Value` v
on (i.name=v.parent)
where i.name=%(attribute)s and v.attribute_value=%(attribute_value)s""", {
where i.name=%(attribute)s and (v.attribute_value=%(attribute_value)s or i.numeric_values = 1)""", {
"attribute": attr.attribute,
"attribute_value": attr.attribute_value
}, as_dict=True)
@@ -180,11 +180,8 @@ def make_variant_item_code(template_item_code, variant):
# frappe.bold(attr.attribute_value)), title=_('Invalid Attribute'),
# exc=InvalidItemAttributeValueError)
if item_attribute[0].numeric_values:
# don't generate item code if one of the attributes is numeric
return
abbreviations.append(item_attribute[0].abbr)
abbr_or_value = cstr(attr.attribute_value) if item_attribute[0].numeric_values else item_attribute[0].abbr
abbreviations.append(abbr_or_value)
if abbreviations:
variant.item_code = "{0}-{1}".format(template_item_code, "-".join(abbreviations))

View File

@@ -2,8 +2,8 @@
{%= frappe.boot.letter_heads[filters.letter_head || frappe.defaults.get_default("letter_head")] %}
</div>
<h2 class="text-center">{%= __(report.report_name) %}</h2>
<h5 class="text-center">Fiscal Year: {%= filters.fiscal_year %}</h5>
<h5 class="text-center">Month: {%= filters.month %}</h5>
<h5 class="text-center">From Date: {%= filters.from_date %}</h5>
<h5 class="text-center">To Date: {%= filters.to_date %}</h5>
<hr>
<table class="table table-bordered">
<thead>

View File

@@ -50,7 +50,9 @@ class SalesOrder(SellingController):
# validate transaction date v/s delivery date
if self.delivery_date:
if getdate(self.transaction_date) > getdate(self.delivery_date):
frappe.throw(_("Expected Delivery Date cannot be before Sales Order Date"))
frappe.msgprint(_("Expected Delivery Date is be before Sales Order Date"),
indicator='orange',
title=_('Warning'))
def validate_po(self):
# validate p.o date v/s delivery date
@@ -81,7 +83,8 @@ class SalesOrder(SellingController):
unique_chk_list = set(check_list)
if len(unique_chk_list) != len(check_list) and \
not cint(frappe.db.get_single_value("Selling Settings", "allow_multiple_items")):
frappe.msgprint(_("Warning: Same item has been entered multiple times."))
frappe.msgprint(_("Same item has been entered multiple times"),
title=_("Warning"), indicator='orange')
def product_bundle_has_stock_item(self, product_bundle):
"""Returns true if product bundle has stock item"""
@@ -442,7 +445,7 @@ def make_sales_invoice(source_name, target_doc=None, ignore_permissions=False):
target.amount = flt(source.amount) - flt(source.billed_amt)
target.base_amount = target.amount * flt(source_parent.conversion_rate)
target.qty = target.amount / flt(source.rate) if (source.rate and source.billed_amt) else source.qty
item = frappe.db.get_value("Item", target.item_code, ["item_group", "selling_cost_center"], as_dict=1)
target.cost_center = frappe.db.get_value("Project", source_parent.project, "cost_center") \
or item.selling_cost_center \

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,91 @@ 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 your School in ERPNext"),
"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": "Setup Master Data",
"start_date": current_date,
"end_date": frappe.utils.add_days(current_date, 1),
"file": "school_masters.md"
}]
else:
tasks += [
{
"title": "Setup Your Company",
"start_date": current_date,
"end_date": frappe.utils.add_days(current_date, 1),
"file": "masters.md"
},
{
"title": "Run Billing Cycle",
"start_date": frappe.utils.add_days(current_date, 3),
"end_date": frappe.utils.add_days(current_date, 4)
"title": "Start Tracking your Sales",
"start_date": current_date,
"end_date": frappe.utils.add_days(current_date, 2),
"file": "sales.md"
},
{
"title": "Run Purchase Cycle",
"start_date": frappe.utils.add_days(current_date, 4),
"end_date": frappe.utils.add_days(current_date, 5)
"title": "Start Managing Purchases",
"start_date": current_date,
"end_date": frappe.utils.add_days(current_date, 3),
"file": "purchase.md"
},
{
"title": "Import Data",
"start_date": frappe.utils.add_days(current_date, 5),
"end_date": frappe.utils.add_days(current_date, 6)
"start_date": current_date,
"end_date": frappe.utils.add_days(current_date, 4),
"file": "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, 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()
# trigger the first message!
from frappe.email.doctype.email_alert.email_alert import trigger_daily_alerts
trigger_daily_alerts()
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,7 @@
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, get familiar with the surroundings. ERPNext covers a *lot of features*, go to the home page and click on the "Explore" icon.
All the best!

View File

@@ -0,0 +1,18 @@
Ready to go live with ERPNext? 🏁🏁🏁
Here are the steps:
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**
If you need help for going live, sign up for an account at erpnext.com or find a partner to help you with this.
Or you can watch these videos 📺:
Setup your chart of accounts: https://www.youtube.com/watch?v=AcfMCT7wLLo
Add Open Stock: https://www.youtube.com/watch?v=nlHX0ZZ84Lw
Add Opening Balances: https://www.youtube.com/watch?v=nlHX0ZZ84Lw

View File

@@ -0,0 +1,5 @@
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, import it into ERPNext with the Data Import Tool.
Watch this video to get started: https://www.youtube.com/watch?v=Ta2Xx3QoK3E

View File

@@ -0,0 +1,7 @@
Start building a model of your business in ERPNext by adding your Items and Customers.
These videos 📺 will help you get started:
Adding Customers and Suppliers: https://www.youtube.com/watch?v=zsrrVDk6VBs
Adding Items and Prices: https://www.youtube.com/watch?v=FcOsV-e8ymE

View File

@@ -0,0 +1,10 @@
How to manage your purchasing in ERPNext 🛒🛒🛒:
1. Add a few **Suppliers**
2. Find out what you need by making **Material Requests**.
3. Now start placing orders via **Purchase Order**.
4. When your suppliers deliver, make **Purchase Receipts**
Now never run out of stock again! 😎
Watch this video 📺 to get an overview: https://www.youtube.com/watch?v=4TN9kPyfIqM

View File

@@ -0,0 +1,8 @@
Start managing your sales with ERPNext 🔔🔔🔔:
1. Add potential business contacts as **Leads**
2. Udpate your deals in pipeline in **Opportunities**
3. Send proposals to your leads or customers with **Quotations**
4. Track confirmed orders with **Sales Orders**
Watch this video 📺 to get an overview: https://www.youtube.com/watch?v=o9XCSZHJfpA

View File

@@ -0,0 +1,5 @@
Lets import some data! 💪💪
If you are already running a school, you most likely have your Students in some spreadsheet file somewhere. Import it into ERPNext with the Data Import Tool.
Watch this video to get started: https://www.youtube.com/watch?v=Ta2Xx3QoK3E

View File

@@ -0,0 +1,9 @@
Lets start making things in ERPNext that are representative 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**
Watch this video to learn more about ERPNext Schools: https://www.youtube.com/watch?v=f6foQOyGzdA

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<br>To edit this, and setup other alerts, just type <b>Email Alert</b> in the search bar.</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},

View File

@@ -68,7 +68,7 @@ frappe.ui.form.on("Item", {
frm.set_intro(__("This Item is a Variant of {0} (Template). Attributes will be copied over from the template unless 'No Copy' is set", [frm.doc.variant_of]), true);
}
if (frappe.defaults.get_default("item_naming_by")!="Naming Series") {
if (frappe.defaults.get_default("item_naming_by")!="Naming Series" || frm.doc.variant_of) {
frm.toggle_display("naming_series", false);
} else {
erpnext.toggle_naming_series();

View File

@@ -162,14 +162,14 @@ class TestItem(unittest.TestCase):
variant = create_variant("_Test Numeric Template Item",
{"Test Size": "Large", "Test Item Length": 1.1})
self.assertEquals(variant.item_code, None)
self.assertEquals(variant.item_code, "_Test Numeric Template Item-L-1.1")
variant.item_code = "_Test Numeric Variant-L-1.1"
variant.item_name = "_Test Numeric Variant Large 1.1m"
self.assertRaises(InvalidItemAttributeValueError, variant.save)
variant = create_variant("_Test Numeric Template Item",
{"Test Size": "Large", "Test Item Length": 1.5})
self.assertEquals(variant.item_code, None)
self.assertEquals(variant.item_code, "_Test Numeric Template Item-L-1.5")
variant.item_code = "_Test Numeric Variant-L-1.5"
variant.item_name = "_Test Numeric Variant Large 1.5m"
variant.save()

View File

@@ -58,80 +58,94 @@ def get_help_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=3
),
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