Merge pull request #7747 from KanchanChauhan/item-name-asset
[Minor] Item Name in Asset
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index dcc072d..6a7922a 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
-__version__ = '7.2.19'
+__version__ = '7.2.20'
def get_default_company(user=None):
'''Get default company for user'''
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js
index 6528c8f..0130366 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.js
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js
@@ -85,8 +85,13 @@
frm.events.show_general_ledger(frm);
},
+ company: function(frm) {
+ frm.events.hide_unhide_fields(frm);
+ frm.events.set_dynamic_labels(frm);
+ },
+
hide_unhide_fields: function(frm) {
- var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
+ var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: "";
frm.toggle_display("source_exchange_rate",
(frm.doc.paid_amount && frm.doc.paid_from_account_currency != company_currency));
@@ -124,7 +129,7 @@
},
set_dynamic_labels: function(frm) {
- var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
+ var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: "";
frm.set_currency_labels(["base_paid_amount", "base_received_amount", "base_total_allocated_amount",
"difference_amount"], company_currency);
@@ -137,6 +142,10 @@
frm.set_currency_labels(["total_allocated_amount", "unallocated_amount"], party_account_currency);
+ var currency_field = (frm.doc.payment_type=="Receive") ? "paid_from_account_currency" : "paid_to_account_currency"
+ frm.set_df_property("total_allocated_amount", "options", currency_field);
+ frm.set_df_property("unallocated_amount", "options", currency_field);
+
frm.set_currency_labels(["total_amount", "outstanding_amount", "allocated_amount"],
party_account_currency, "references");
@@ -747,4 +756,4 @@
deductions_remove: function(frm) {
frm.events.set_difference_amount(frm);
}
-})
\ No newline at end of file
+})
diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js
index b5e195c..def67d8 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.js
+++ b/erpnext/crm/doctype/opportunity/opportunity.js
@@ -101,8 +101,7 @@
$.each([["lead", "lead"],
["customer", "customer"],
- ["contact_person", "customer_filter"],
- ["territory", "not_a_group_filter"]], function(i, opts) {
+ ["contact_person", "customer_filter"]], function(i, opts) {
me.frm.set_query(opts[0], erpnext.queries[opts[1]]);
});
},
diff --git a/erpnext/docs/install.md b/erpnext/docs/install.md
index 26ad128..c6a87cb 100644
--- a/erpnext/docs/install.md
+++ b/erpnext/docs/install.md
@@ -8,7 +8,7 @@
After you have installed Frappe Bench, go to you bench folder, which is `frappe.bench` by default and setup **erpnext**.
- bench get-app erpnext {{ source_link }}
+ bench get-app erpnext https://github.com/frappe/erpnext
Then create a new site to install the app.
@@ -27,4 +27,4 @@
Fire up your browser and go to http://localhost:8000 and you should see the login screen. Login as **Administrator** and **admin** (or the password you set at the time of `new-site`) and you are set.
<!-- jinja -->
-<!-- autodoc -->
\ No newline at end of file
+<!-- autodoc -->
diff --git a/erpnext/hr/doctype/appraisal/appraisal.json b/erpnext/hr/doctype/appraisal/appraisal.json
index 0906557..450a47b 100644
--- a/erpnext/hr/doctype/appraisal/appraisal.json
+++ b/erpnext/hr/doctype/appraisal/appraisal.json
@@ -21,7 +21,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@@ -49,7 +48,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Series",
@@ -79,7 +77,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Appraisal Template",
@@ -111,7 +108,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 1,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "For Employee",
@@ -142,7 +138,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "For Employee Name",
@@ -172,7 +167,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -202,7 +196,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 1,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Status",
@@ -233,7 +226,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 1,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Start Date",
@@ -263,7 +255,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "End Date",
@@ -293,7 +284,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Goals",
@@ -322,7 +312,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Goals",
@@ -337,7 +326,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 1,
+ "reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -352,7 +341,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Calculate Total Score",
@@ -381,7 +369,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Total Score (Out of 5)",
@@ -411,7 +398,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -438,7 +424,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Remarks",
@@ -466,7 +451,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@@ -493,7 +477,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Company",
@@ -523,7 +506,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -550,7 +532,6 @@
"hidden": 1,
"ignore_user_permissions": 1,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Amended From",
@@ -583,7 +564,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-11-07 05:47:32.082712",
+ "modified": "2017-02-14 04:54:28.784666",
"modified_by": "Administrator",
"module": "HR",
"name": "Appraisal",
@@ -599,7 +580,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
- "is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -620,7 +600,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
- "is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -641,7 +620,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
- "is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -661,5 +639,6 @@
"sort_order": "DESC",
"timeline_field": "employee",
"title_field": "employee_name",
+ "track_changes": 0,
"track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/appraisal/appraisal.py b/erpnext/hr/doctype/appraisal/appraisal.py
index df6d770..e69dfa8 100644
--- a/erpnext/hr/doctype/appraisal/appraisal.py
+++ b/erpnext/hr/doctype/appraisal/appraisal.py
@@ -16,6 +16,9 @@
if not self.status:
self.status = "Draft"
+ if not self.goals:
+ frappe.throw(_("Goals cannot be empty"))
+
set_employee_name(self)
self.validate_dates()
self.validate_existing_appraisal()
diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py
index 5b565fa..84c14c9 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.py
+++ b/erpnext/hr/doctype/leave_application/leave_application.py
@@ -25,7 +25,7 @@
def validate(self):
if not getattr(self, "__islocal", None) and frappe.db.exists(self.doctype, self.name):
- self.previous_doc = frappe.db.get_value(self.doctype, self.name, "*", as_dict=True)
+ self.previous_doc = frappe.get_value(self.doctype, self.name, "leave_approver", as_dict=True)
else:
self.previous_doc = None
@@ -46,14 +46,10 @@
self.status == "Open" and self.previous_doc.leave_approver != self.leave_approver):
# notify leave approver about creation
self.notify_leave_approver()
- elif self.previous_doc and \
- self.previous_doc.status == "Open" and self.status == "Rejected":
- # notify employee about rejection
- self.notify_employee(self.status)
def on_submit(self):
- if self.status != "Approved":
- frappe.throw(_("Only Leave Applications with status 'Approved' can be submitted"))
+ if self.status == "Open":
+ frappe.throw(_("Only Leave Applications with status 'Approved' and 'Rejected' can be submitted"))
self.validate_back_dated_application()
@@ -234,13 +230,18 @@
else:
name = self.name
- return (_("Leave Application") + ": %s - %s") % (name, _(status))
+ message = "Leave Application: {name}".format(name=name)+"<br>"
+ message += "Leave Type: {leave_type}".format(leave_type=self.leave_type)+"<br>"
+ message += "From Date: {from_date}".format(from_date=self.from_date)+"<br>"
+ message += "To Date: {to_date}".format(to_date=self.to_date)+"<br>"
+ message += "Status: {status}".format(status=_(status))
+ return message
self.notify({
# for post in messages
"message": _get_message(url=True),
"message_to": employee.user_id,
- "subject": _get_message(),
+ "subject": (_("Leave Application") + ": %s - %s") % (self.name, _(status))
})
def notify_leave_approver(self):
@@ -252,8 +253,12 @@
if url:
name = get_link_to_form(self.doctype, self.name)
employee_name = get_link_to_form("Employee", self.employee, label=employee_name)
-
- return (_("New Leave Application") + ": %s - " + _("Employee") + ": %s") % (name, employee_name)
+ message = (_("Leave Application") + ": %s") % (name)+"<br>"
+ message += (_("Employee") + ": %s") % (employee_name)+"<br>"
+ message += (_("Leave Type") + ": %s") % (self.leave_type)+"<br>"
+ message += (_("From Date") + ": %s") % (self.from_date)+"<br>"
+ message += (_("To Date") + ": %s") % (self.to_date)
+ return message
self.notify({
# for post in messages
@@ -261,7 +266,7 @@
"message_to": self.leave_approver,
# for email
- "subject": _get_message()
+ "subject": (_("New Leave Application") + ": %s - " + _("Employee") + ": %s") % (self.name, cstr(employee.employee_name))
})
def notify(self, args):
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py
index 5ff1248..9d57a5d 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.py
@@ -283,6 +283,7 @@
where t2.name = t1.leave_type
and t2.is_lwp = 1
and t1.docstatus = 1
+ and t1.status = 'Approved'
and t1.employee = %(employee)s
and CASE WHEN t2.include_holiday != 1 THEN %(dt)s not in ('{0}') and %(dt)s between from_date and to_date
WHEN t2.include_holiday THEN %(dt)s between from_date and to_date
diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py
index 37fcc11..b5ef4bf 100644
--- a/erpnext/projects/doctype/project/project.py
+++ b/erpnext/projects/doctype/project/project.py
@@ -119,6 +119,8 @@
def update_percent_complete(self):
total = frappe.db.sql("""select count(name) from tabTask where project=%s""", self.name)[0][0]
+ if not total and self.percent_complete:
+ self.percent_complete = 0
if (self.percent_complete_method == "Task Completion" and total > 0) or (not self.percent_complete_method and total > 0):
completed = frappe.db.sql("""select count(name) from tabTask where
project=%s and status in ('Closed', 'Cancelled')""", self.name)[0][0]
diff --git a/erpnext/projects/doctype/task/task.json b/erpnext/projects/doctype/task/task.json
index 7433222..811626d 100644
--- a/erpnext/projects/doctype/task/task.json
+++ b/erpnext/projects/doctype/task/task.json
@@ -21,7 +21,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 1,
+ "in_filter": 0,
+ "in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Subject",
@@ -51,6 +52,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 1,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Project",
@@ -81,6 +83,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -110,6 +113,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Status",
@@ -139,7 +143,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 1,
+ "in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Priority",
@@ -170,6 +175,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -197,6 +203,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Expected Start Date",
@@ -228,6 +235,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Expected Time (in hours)",
@@ -257,6 +265,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Weight",
@@ -285,6 +294,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -311,7 +321,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 1,
+ "in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Expected End Date",
@@ -341,6 +352,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "% Progress",
@@ -369,6 +381,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -397,6 +410,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Details",
@@ -428,6 +442,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Depends On",
@@ -456,6 +471,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "depends_on",
@@ -485,6 +501,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "depends_on_tasks",
@@ -514,6 +531,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@@ -544,6 +562,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Actual Start Date (via Time Sheet)",
@@ -575,6 +594,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Actual Time (in hours)",
@@ -604,6 +624,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -631,6 +652,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Actual End Date (via Time Sheet)",
@@ -660,6 +682,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -687,6 +710,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Total Costing Amount (via Time Sheet)",
@@ -717,6 +741,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Total Expense Claim (via Expense Claim)",
@@ -746,6 +771,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -773,6 +799,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Total Billing Amount (via Time Sheet)",
@@ -801,6 +828,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@@ -829,6 +857,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Review Date",
@@ -859,6 +888,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Closing Date",
@@ -888,6 +918,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -914,6 +945,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Company",
@@ -944,7 +976,7 @@
"istable": 0,
"max_attachments": 5,
"menu_index": 0,
- "modified": "2017-01-27 01:26:24.985167",
+ "modified": "2017-02-14 22:46:02.027284",
"modified_by": "Administrator",
"module": "Projects",
"name": "Task",
@@ -975,6 +1007,7 @@
"read_only": 0,
"read_only_onload": 0,
"search_fields": "subject",
+ "show_name_in_global_search": 0,
"sort_order": "DESC",
"timeline_field": "project",
"title_field": "subject",
diff --git a/erpnext/public/js/templates/contact_list.html b/erpnext/public/js/templates/contact_list.html
index 765ddf8..abaadff 100644
--- a/erpnext/public/js/templates/contact_list.html
+++ b/erpnext/public/js/templates/contact_list.html
@@ -1,20 +1,23 @@
<p><button class="btn btn-xs btn-default btn-contact">
{{ __("New Contact") }}</button></p>
<div class="clearfix"></div>
-
+<ol>
{% for(var i=0, l=contact_list.length; i<l; i++) { %}
<p class="h6">
- {%= i+1 %}. {%= contact_list[i].first_name %} {%= contact_list[i].last_name %}
- {% if(contact_list[i].is_primary_contact) { %}
- <span class="text-muted">({%= __("Primary") %})</span>
- {% } %}
- {% if(contact_list[i].designation){ %}
- <span class="text-muted">– {%= contact_list[i].designation %}</span>
- {% } %}
- <a href="#Form/Contact/{%= encodeURIComponent(contact_list[i].name) %}"
- class="btn btn-xs btn-default pull-right">
- {%= __("Edit") %}</a>
- </p>
+ <li>
+ {%= contact_list[i].first_name %} {%= contact_list[i].last_name %}
+ {% if(contact_list[i].is_primary_contact) { %}
+ <span class="text-muted">({%= __("Primary") %})</span>
+ {% } %}
+ {% if(contact_list[i].designation){ %}
+ <span class="text-muted">– {%= contact_list[i].designation %}</span>
+ {% } %}
+ <a href="#Form/Contact/{%= encodeURIComponent(contact_list[i].name) %}"
+ class="btn btn-xs btn-default pull-right">
+ {%= __("Edit") %}</a>
+ </li>
+ </p>
+
<div style="padding-left: 15px;">
<p style="padding-top: 5px; font-size: 12px;">
{% if(contact_list[i].phone) { %}
@@ -29,6 +32,7 @@
</p>
</div>
{% } %}
+</ol>
{% if(!contact_list.length) { %}
<p class="text-muted">{%= __("No contacts added yet.") %}</p>
-{% } %}
+{% } %}
\ No newline at end of file
diff --git a/erpnext/schools/api.py b/erpnext/schools/api.py
index 313b5ff..f1d3753 100644
--- a/erpnext/schools/api.py
+++ b/erpnext/schools/api.py
@@ -8,6 +8,7 @@
from frappe import _
from frappe.model.mapper import get_mapped_doc
from frappe.utils import flt, cstr
+from frappe.email.doctype.email_group.email_group import add_subscribers
@frappe.whitelist()
def enroll_student(source_name):
@@ -83,6 +84,16 @@
student_attendance.submit()
@frappe.whitelist()
+def get_student_guardians(student):
+ """Returns List of Guardians of a Student.
+
+ :param student: Student.
+ """
+ guardians = frappe.get_list("Student Guardian", fields=["guardian"] ,
+ filters={"parent": student})
+ return guardians
+
+@frappe.whitelist()
def get_student_batch_students(student_batch):
"""Returns List of student, student_name, idx in Student Batch.
@@ -253,4 +264,23 @@
})
assessment_result.save()
assessment_result.submit()
- return assessment_result
\ No newline at end of file
+ return assessment_result
+
+@frappe.whitelist()
+def update_email_group(doctype, name):
+ if not frappe.db.exists("Email Group", name):
+ email_group = frappe.new_doc("Email Group")
+ email_group.title = name
+ email_group.save()
+ email_list = []
+ students = []
+ if doctype == "Student Batch":
+ students = get_student_batch_students(name)
+ if doctype == "Student Group":
+ students = get_student_group_students(name)
+ for stud in students:
+ for guard in get_student_guardians(stud.student):
+ email = frappe.db.get_value("Guardian", guard.guardian, "email_address")
+ if email:
+ email_list.append(email)
+ add_subscribers(name, email_list)
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_batch/student_batch.js b/erpnext/schools/doctype/student_batch/student_batch.js
index 931e41b..7fad5d7 100644
--- a/erpnext/schools/doctype/student_batch/student_batch.js
+++ b/erpnext/schools/doctype/student_batch/student_batch.js
@@ -3,7 +3,23 @@
frappe.ui.form.on('Student Batch', {
refresh: function(frm) {
-
+ if (!frm.doc.__islocal) {
+ frm.add_custom_button(__("Update Email Group"), function() {
+ frappe.call({
+ method: "erpnext.schools.api.update_email_group",
+ args: {
+ "doctype": "Student Batch",
+ "name": frm.doc.name
+ }
+ });
+ });
+ frm.add_custom_button(__("Newsletter"), function() {
+ frappe.route_options = {
+ email_group: frm.doc.name
+ }
+ frappe.set_route("List", "Newsletter");
+ });
+ }
},
onload: function(frm){
diff --git a/erpnext/schools/doctype/student_batch/student_batch.py b/erpnext/schools/doctype/student_batch/student_batch.py
index 1a0d799..9c0f3d7 100644
--- a/erpnext/schools/doctype/student_batch/student_batch.py
+++ b/erpnext/schools/doctype/student_batch/student_batch.py
@@ -6,6 +6,7 @@
from frappe.model.document import Document
from erpnext.schools.utils import validate_duplicate_student
import frappe
+from frappe import _
class StudentBatch(Document):
def autoname(self):
@@ -16,3 +17,8 @@
def validate(self):
validate_duplicate_student(self.students)
+ self.validate_name()
+
+ def validate_name(self):
+ if frappe.db.exists("Student Group", self.name):
+ frappe.throw(_("""Student Group exists with same name"""))
diff --git a/erpnext/schools/doctype/student_group/student_group.js b/erpnext/schools/doctype/student_group/student_group.js
index 392793a..1dcbc3a 100644
--- a/erpnext/schools/doctype/student_group/student_group.js
+++ b/erpnext/schools/doctype/student_group/student_group.js
@@ -1,33 +1,48 @@
cur_frm.add_fetch("student", "title", "student_name");
frappe.ui.form.on("Student Group", {
- refresh: function(frm) {
- if (!frm.doc.__islocal) {
- frm.add_custom_button(__("Course Schedule"), function() {
- frappe.route_options = {
- student_group: frm.doc.name
- }
- frappe.set_route("List", "Course Schedule");
- });
+ refresh: function(frm) {
+ if (!frm.doc.__islocal) {
+ frm.add_custom_button(__("Course Schedule"), function() {
+ frappe.route_options = {
+ student_group: frm.doc.name
+ }
+ frappe.set_route("List", "Course Schedule");
+ });
- frm.add_custom_button(__("Assessment Plan"), function() {
- frappe.route_options = {
- student_group: frm.doc.name
- }
- frappe.set_route("List", "Assessment Plan");
- });
- }
- },
+ frm.add_custom_button(__("Assessment Plan"), function() {
+ frappe.route_options = {
+ student_group: frm.doc.name
+ }
+ frappe.set_route("List", "Assessment Plan");
+ });
+ frm.add_custom_button(__("Update Email Group"), function() {
+ frappe.call({
+ method: "erpnext.schools.api.update_email_group",
+ args: {
+ "doctype": "Student Group",
+ "name": frm.doc.name
+ }
+ });
+ });
+ frm.add_custom_button(__("Newsletter"), function() {
+ frappe.route_options = {
+ email_group: frm.doc.name
+ }
+ frappe.set_route("List", "Newsletter");
+ });
+ }
+ },
- onload: function(frm) {
- cur_frm.set_query("academic_term", function() {
- return {
- "filters": {
- "academic_year": (frm.doc.academic_year)
- }
- };
- });
- }
+ onload: function(frm) {
+ frm.set_query("academic_term", function() {
+ return {
+ "filters": {
+ "academic_year": (frm.doc.academic_year)
+ }
+ };
+ });
+ }
});
//If Student Batch is entered, deduce program, academic_year and academic term from it
diff --git a/erpnext/schools/doctype/student_group/student_group.py b/erpnext/schools/doctype/student_group/student_group.py
index 2f27957..996f518 100644
--- a/erpnext/schools/doctype/student_group/student_group.py
+++ b/erpnext/schools/doctype/student_group/student_group.py
@@ -30,6 +30,7 @@
def validate(self):
self.validate_strength()
self.validate_student_name()
+ self.validate_name()
if self.student_batch:
self.validate_student_batch()
validate_duplicate_student(self.students)
@@ -42,6 +43,10 @@
for d in self.students:
d.student_name = frappe.db.get_value("Student", d.student, "title")
+ def validate_name(self):
+ if frappe.db.exists("Student Batch", self.name):
+ frappe.throw(_("""Student Batch exists with same name"""))
+
def validate_student_batch(self):
student_batch_students = []
for d in get_student_batch_students(self.student_batch):
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 5748a93..6de497f 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -25,6 +25,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@@ -54,6 +55,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Series",
@@ -83,6 +85,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Item Code",
@@ -114,6 +117,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Variant Of",
@@ -142,7 +146,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 1,
+ "in_filter": 0,
+ "in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Item Name",
@@ -172,6 +177,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Barcode",
@@ -199,7 +205,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 1,
+ "in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Item Group",
@@ -231,6 +238,7 @@
"ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Unit of Measure",
@@ -261,6 +269,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -287,6 +296,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Disabled",
@@ -317,6 +327,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Maintain Stock",
@@ -348,6 +359,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Opening Stock",
@@ -377,6 +389,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Valuation Rate",
@@ -405,6 +418,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Standard Selling Rate",
@@ -433,6 +447,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Fixed Asset",
@@ -462,6 +477,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Asset Category",
@@ -491,6 +507,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Image",
@@ -520,6 +537,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Description",
@@ -548,6 +566,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Brand",
@@ -578,6 +597,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Description",
@@ -609,6 +629,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Inventory",
@@ -640,6 +661,7 @@
"ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Warehouse",
@@ -672,6 +694,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "End of Life",
@@ -703,6 +726,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Has Batch No",
@@ -735,7 +759,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 1,
+ "in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Has Serial No",
@@ -768,6 +793,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Serial Number Series",
@@ -796,6 +822,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Material Request Type",
@@ -826,6 +853,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -856,6 +884,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Allow over delivery or receipt upto this percent",
@@ -886,6 +915,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Valuation Method",
@@ -915,6 +945,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Warranty Period (in days)",
@@ -946,6 +977,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Net Weight",
@@ -974,6 +1006,7 @@
"ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Weight UOM",
@@ -1004,6 +1037,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Auto re-order",
@@ -1034,6 +1068,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Reorder level based on Warehouse",
@@ -1063,6 +1098,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Units of Measure",
@@ -1093,6 +1129,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "UOMs",
@@ -1125,6 +1162,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Variants",
@@ -1156,6 +1194,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Has Variants",
@@ -1186,6 +1225,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Attributes",
@@ -1215,6 +1255,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Purchase Details",
@@ -1245,6 +1286,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Purchase Item",
@@ -1276,6 +1318,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Minimum Order Qty",
@@ -1305,6 +1348,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Safety Stock",
@@ -1335,6 +1379,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Lead Time in days",
@@ -1366,6 +1411,7 @@
"ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Buying Cost Center",
@@ -1398,6 +1444,7 @@
"ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Expense Account",
@@ -1429,6 +1476,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Last Purchase Rate",
@@ -1459,6 +1507,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Supplier Details",
@@ -1488,6 +1537,7 @@
"ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Supplier",
@@ -1516,6 +1566,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Delivered by Supplier (Drop Ship)",
@@ -1545,6 +1596,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Manufacturer",
@@ -1574,6 +1626,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Manufacturer Part Number",
@@ -1602,6 +1655,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Item Code for Suppliers",
@@ -1632,6 +1686,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Supplier Items",
@@ -1660,6 +1715,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Sales Details",
@@ -1690,6 +1746,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Sales Item",
@@ -1720,6 +1777,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Publish in Hub",
@@ -1749,6 +1807,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Synced With Hub",
@@ -1778,6 +1837,7 @@
"ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Income Account",
@@ -1807,6 +1867,7 @@
"ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Selling Cost Center",
@@ -1836,6 +1897,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Customer Item Codes",
@@ -1867,6 +1929,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Customer Items",
@@ -1896,6 +1959,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Max Discount (%)",
@@ -1925,6 +1989,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Item Tax",
@@ -1955,6 +2020,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Taxes",
@@ -1985,6 +2051,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Inspection Criteria",
@@ -2015,6 +2082,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Inspection Required before Purchase",
@@ -2045,6 +2113,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Inspection Required before Delivery",
@@ -2075,6 +2144,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Quality Parameters",
@@ -2106,6 +2176,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Manufacturing",
@@ -2136,6 +2207,7 @@
"ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default BOM",
@@ -2168,6 +2240,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Supply Raw Materials for Purchase",
@@ -2198,6 +2271,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -2224,7 +2298,8 @@
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 1,
+ "in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Customer Code",
@@ -2252,6 +2327,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Website",
@@ -2281,6 +2357,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Show in Website",
@@ -2309,6 +2386,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Show in Website (Variant)",
@@ -2338,6 +2416,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Route",
@@ -2368,6 +2447,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Weightage",
@@ -2397,6 +2477,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Slideshow",
@@ -2427,6 +2508,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Image",
@@ -2455,6 +2537,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Thumbnail",
@@ -2483,6 +2566,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -2511,6 +2595,7 @@
"ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Website Warehouse",
@@ -2541,6 +2626,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Website Item Groups",
@@ -2571,6 +2657,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Website Specifications",
@@ -2599,6 +2686,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Copy From Item Group",
@@ -2627,6 +2715,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Website Specifications",
@@ -2656,6 +2745,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Website Description",
@@ -2683,6 +2773,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Total Projected Qty",
@@ -2713,7 +2804,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 1,
- "modified": "2017-01-30 17:25:46.211995",
+ "modified": "2017-02-14 22:49:44.664910",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",
@@ -2884,6 +2975,7 @@
"read_only": 0,
"read_only_onload": 0,
"search_fields": "item_name,description,item_group,customer_code",
+ "show_name_in_global_search": 0,
"sort_field": "idx desc, modified desc",
"sort_order": "DESC",
"title_field": "item_name",
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 53faa43..d20ba49 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -451,24 +451,32 @@
"valuation_method", "has_batch_no", "is_fixed_asset")
vals = frappe.db.get_value("Item", self.name, to_check, as_dict=True)
+ if not vals.get('valuation_method') and self.get('valuation_method'):
+ vals['valuation_method'] = frappe.db.get_single_value("Stock Settings", "valuation_method") or "FIFO"
if vals:
for key in to_check:
- if self.get(key) != vals.get(key):
- if not self.check_if_linked_document_exists():
+ if cstr(self.get(key)) != cstr(vals.get(key)):
+ if not self.check_if_linked_document_exists(key):
break # no linked document, allowed
else:
- frappe.throw(_("As there are existing transactions for this item, you can not change the value of {0}").format(frappe.bold(self.meta.get_label(key))))
+ frappe.throw(_("As there are existing transactions against item {0}, you can not change the value of {1}").format(self.name, frappe.bold(self.meta.get_label(key))))
if vals and not self.is_fixed_asset and self.is_fixed_asset != vals.is_fixed_asset:
asset = frappe.db.get_all("Asset", filters={"item_code": self.name, "docstatus": 1}, limit=1)
if asset:
frappe.throw(_('"Is Fixed Asset" cannot be unchecked, as Asset record exists against the item'))
- def check_if_linked_document_exists(self):
- for doctype in ("Sales Order Item", "Delivery Note Item", "Sales Invoice Item",
- "Material Request Item", "Purchase Order Item", "Purchase Receipt Item",
- "Purchase Invoice Item", "Stock Entry Detail", "Stock Reconciliation Item"):
+ def check_if_linked_document_exists(self, key):
+ linked_doctypes = ["Delivery Note Item", "Sales Invoice Item", "Purchase Receipt Item",
+ "Purchase Invoice Item", "Stock Entry Detail", "Stock Reconciliation Item"]
+
+ # For "Is Stock Item", following doctypes is important
+ # because reserved_qty, ordered_qty and requested_qty updated from these doctypes
+ if key == "is_stock_item":
+ linked_doctypes += ["Sales Order Item", "Purchase Order Item", "Material Request Item"]
+
+ for doctype in linked_doctypes:
if frappe.db.get_value(doctype, filters={"item_code": self.name, "docstatus": 1}) or \
frappe.db.get_value("Production Order",
filters={"production_item": self.name, "docstatus": 1}):
diff --git a/erpnext/stock/report/serial_no_status/serial_no_status.json b/erpnext/stock/report/serial_no_status/serial_no_status.json
index cb4e70d..99b99f7 100644
--- a/erpnext/stock/report/serial_no_status/serial_no_status.json
+++ b/erpnext/stock/report/serial_no_status/serial_no_status.json
@@ -7,8 +7,8 @@
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
- "json": "{\"add_total_row\": 0, \"sort_by\": \"Serial No.name\", \"sort_order\": \"desc\", \"sort_by_next\": null, \"filters\": [], \"sort_order_next\": \"desc\", \"columns\": [[\"name\", \"Serial No\"], [\"item_code\", \"Serial No\"], [\"warehouse\", \"Serial No\"], [\"item_name\", \"Serial No\"], [\"description\", \"Serial No\"], [\"item_group\", \"Serial No\"], [\"brand\", \"Serial No\"], [\"purchase_document_no\", \"Serial No\"], [\"purchase_date\", \"Serial No\"], [\"customer\", \"Serial No\"], [\"customer_name\", \"Serial No\"], [\"purchase_rate\", \"Serial No\"], [\"delivery_document_no\", \"Serial No\"], [\"delivery_date\", \"Serial No\"], [\"supplier\", \"Serial No\"], [\"supplier_name\", \"Serial No\"]]}",
- "modified": "2016-12-05 18:49:31.424300",
+ "json": "{\"add_total_row\": 0, \"sort_by\": \"Serial No.name\", \"sort_order\": \"desc\", \"sort_by_next\": null, \"filters\": [], \"sort_order_next\": \"desc\", \"columns\": [[\"name\", \"Serial No\"], [\"item_code\", \"Serial No\"], [\"warehouse\", \"Serial No\"], [\"item_name\", \"Serial No\"], [\"description\", \"Serial No\"], [\"item_group\", \"Serial No\"], [\"brand\", \"Serial No\"], [\"purchase_document_type\", \"Serial No\"], [\"purchase_document_no\", \"Serial No\"], [\"purchase_date\", \"Serial No\"], [\"customer\", \"Serial No\"], [\"customer_name\", \"Serial No\"], [\"purchase_rate\", \"Serial No\"], [\"delivery_document_type\", \"Serial No\"], [\"delivery_document_no\", \"Serial No\"], [\"delivery_date\", \"Serial No\"], [\"supplier\", \"Serial No\"], [\"supplier_name\", \"Serial No\"]]}",
+ "modified": "2017-02-14 18:50:31.424300",
"modified_by": "Administrator",
"module": "Stock",
"name": "Serial No Status",
diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py
index e5c6ee1..2798f70 100644
--- a/erpnext/support/doctype/issue/issue.py
+++ b/erpnext/support/doctype/issue/issue.py
@@ -81,10 +81,9 @@
st.save()
def auto_close_tickets():
- issues = frappe.db.get_all("Issue", filters={
- "status": "Replied",
- "modified": ("<", "date_sub(curdate(),interval 7 Day)")
- }, fields=["name"])
+ """ auto close the replied support tickets after 7 days """
+ issues = frappe.db.sql(""" select name from tabIssue where status='Replied' and
+ modified<DATE_SUB(CURDATE(), INTERVAL 7 DAY) """, as_dict=True)
for issue in issues:
doc = frappe.get_doc("Issue", issue.get("name"))
diff --git a/erpnext/templates/generators/job_opening.html b/erpnext/templates/generators/job_opening.html
index 5998e3f..f92e72e 100644
--- a/erpnext/templates/generators/job_opening.html
+++ b/erpnext/templates/generators/job_opening.html
@@ -15,7 +15,7 @@
{% endif %}
<p style='margin-top: 30px'>
<a class='btn btn-primary'
- href='/job_application?job_title={{ doc.name }}'>
+ href='/job_application?new=1&job_title={{ doc.name }}'>
{{ _("Apply Now") }}</a>
</p>