Merge pull request #7677 from KanchanChauhan/serial-no-in-return

[Fix] Serial No if is_return
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index f026cb0..4fb3dba 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -6,7 +6,7 @@
  "beta": 0, 
  "creation": "2013-05-24 19:29:05", 
  "custom": 0, 
- "default_print_format": "Standard", 
+ "default_print_format": "Sample Print", 
  "docstatus": 0, 
  "doctype": "DocType", 
  "document_type": "", 
@@ -22,13 +22,12 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "icon-user", 
+   "options": "fa fa-user", 
    "permlevel": 0, 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
@@ -51,7 +50,6 @@
    "hidden": 1, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Title", 
@@ -79,7 +77,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Series", 
@@ -109,7 +106,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 1, 
    "label": "Customer", 
@@ -140,7 +136,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Customer Name", 
@@ -169,7 +164,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Is POS", 
@@ -199,7 +193,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Is Return", 
@@ -227,12 +220,11 @@
    "hidden": 1, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Offline POS Name", 
    "length": 0, 
-   "no_copy": 1, 
+   "no_copy": 0, 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -255,7 +247,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -283,7 +274,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Date", 
@@ -312,7 +302,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Payment Due Date", 
@@ -341,7 +330,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Company", 
@@ -371,7 +359,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Project", 
@@ -401,7 +388,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 1, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Amended From", 
@@ -432,7 +418,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Return Against Sales Invoice", 
@@ -462,7 +447,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Address and Contact", 
@@ -490,7 +474,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Customer Address", 
@@ -518,7 +501,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Address", 
@@ -545,7 +527,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Contact Person", 
@@ -573,7 +554,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Contact", 
@@ -600,7 +580,6 @@
    "hidden": 1, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Mobile No", 
@@ -627,7 +606,6 @@
    "hidden": 1, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Contact Email", 
@@ -655,7 +633,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -682,7 +659,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Shipping Address Name", 
@@ -711,7 +687,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Shipping Address", 
@@ -740,7 +715,6 @@
    "hidden": 1, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Customer Group", 
@@ -768,7 +742,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Territory", 
@@ -777,7 +750,7 @@
    "options": "Territory", 
    "permlevel": 0, 
    "precision": "", 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "remember_last_selected_value": 0, 
@@ -798,7 +771,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Currency and Price List", 
@@ -826,7 +798,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Currency", 
@@ -857,7 +828,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Exchange Rate", 
@@ -887,7 +857,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -914,7 +883,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Price List", 
@@ -944,7 +912,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Price List Currency", 
@@ -973,7 +940,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Price List Exchange Rate", 
@@ -1001,7 +967,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Ignore Pricing Rule", 
@@ -1028,14 +993,13 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "", 
    "length": 0, 
    "no_copy": 0, 
    "oldfieldtype": "Section Break", 
-   "options": "icon-shopping-cart", 
+   "options": "fa fa-shopping-cart", 
    "permlevel": 0, 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
@@ -1057,7 +1021,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Update Stock", 
@@ -1086,7 +1049,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Items", 
@@ -1116,13 +1078,12 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Packing List", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "icon-suitcase", 
+   "options": "fa fa-suitcase", 
    "permlevel": 0, 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
@@ -1144,7 +1105,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Packed Items", 
@@ -1172,7 +1132,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Product Bundle Help", 
@@ -1201,7 +1160,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Time Sheet List", 
@@ -1229,7 +1187,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Time Sheets", 
@@ -1259,7 +1216,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Total Billing Amount", 
@@ -1287,7 +1243,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -1313,7 +1268,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Total (Company Currency)", 
@@ -1342,7 +1296,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Net Total (Company Currency)", 
@@ -1372,7 +1325,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -1398,7 +1350,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Net Total", 
@@ -1426,7 +1377,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Total", 
@@ -1455,14 +1405,13 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "", 
    "length": 0, 
    "no_copy": 0, 
    "oldfieldtype": "Section Break", 
-   "options": "icon-money", 
+   "options": "fa fa-money", 
    "permlevel": 0, 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
@@ -1484,7 +1433,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Taxes and Charges", 
@@ -1514,7 +1462,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -1540,7 +1487,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Shipping Rule", 
@@ -1569,7 +1515,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -1595,7 +1540,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Sales Taxes and Charges", 
@@ -1625,7 +1569,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Taxes and Charges Calculation", 
@@ -1653,7 +1596,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -1679,7 +1621,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Total Taxes and Charges (Company Currency)", 
@@ -1709,7 +1650,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -1736,7 +1676,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Total Taxes and Charges", 
@@ -1765,7 +1704,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Additional Discount", 
@@ -1794,7 +1732,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Apply Additional Discount On", 
@@ -1823,7 +1760,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Additional Discount Amount (Company Currency)", 
@@ -1852,7 +1788,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -1878,7 +1813,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Additional Discount Percentage", 
@@ -1906,7 +1840,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Additional Discount Amount", 
@@ -1934,14 +1867,13 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "", 
    "length": 0, 
    "no_copy": 0, 
    "oldfieldtype": "Section Break", 
-   "options": "icon-money", 
+   "options": "fa fa-money", 
    "permlevel": 0, 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
@@ -1963,7 +1895,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Grand Total (Company Currency)", 
@@ -1993,7 +1924,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Rounded Total (Company Currency)", 
@@ -2024,7 +1954,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "In Words (Company Currency)", 
@@ -2053,7 +1982,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -2081,7 +2009,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
    "label": "Grand Total", 
@@ -2111,7 +2038,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Rounded Total", 
@@ -2141,7 +2067,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "In Words", 
@@ -2170,7 +2095,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Total Advance", 
@@ -2200,7 +2124,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 1, 
    "label": "Outstanding Amount", 
@@ -2231,14 +2154,13 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Advance Payments", 
    "length": 0, 
    "no_copy": 0, 
    "oldfieldtype": "Section Break", 
-   "options": "icon-money", 
+   "options": "fa fa-money", 
    "permlevel": 0, 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
@@ -2260,7 +2182,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Get Advances Received", 
@@ -2289,7 +2210,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Advances", 
@@ -2321,13 +2241,12 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Payments", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "icon-money", 
+   "options": "fa fa-money", 
    "permlevel": 0, 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
@@ -2350,7 +2269,6 @@
    "hidden": 1, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Cash/Bank Account", 
@@ -2380,7 +2298,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Sales Invoice Payment", 
@@ -2409,7 +2326,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -2436,7 +2352,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Paid Amount (Company Currency)", 
@@ -2465,7 +2380,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -2493,7 +2407,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Paid Amount", 
@@ -2523,7 +2436,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -2550,7 +2462,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Base Change Amount (Company Currency)", 
@@ -2579,7 +2490,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -2606,7 +2516,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Change Amount", 
@@ -2635,7 +2544,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Account for Change Amount", 
@@ -2666,7 +2574,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Write Off", 
@@ -2695,7 +2602,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Write Off Amount", 
@@ -2723,7 +2629,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Write Off Amount (Company Currency)", 
@@ -2753,7 +2658,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Write Off Outstanding Amount", 
@@ -2781,7 +2685,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -2809,7 +2712,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Write Off Account", 
@@ -2838,7 +2740,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Write Off Cost Center", 
@@ -2867,7 +2768,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Terms", 
@@ -2896,7 +2796,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Terms", 
@@ -2926,7 +2825,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Terms and Conditions Details", 
@@ -2955,7 +2853,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Printing Settings", 
@@ -2983,7 +2880,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Letter Head", 
@@ -3013,7 +2909,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Print Language", 
@@ -3041,7 +2936,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -3068,7 +2962,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Print Heading", 
@@ -3099,7 +2992,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "More Information", 
@@ -3128,7 +3020,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Campaign", 
@@ -3158,7 +3049,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -3186,7 +3076,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Status", 
@@ -3215,7 +3104,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Source", 
@@ -3245,14 +3133,13 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Accounting Details", 
    "length": 0, 
    "no_copy": 0, 
    "oldfieldtype": "Section Break", 
-   "options": "icon-file-text", 
+   "options": "fa fa-file-text", 
    "permlevel": 0, 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
@@ -3275,7 +3162,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Debit To", 
@@ -3305,7 +3191,6 @@
    "hidden": 1, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Party Account Currency", 
@@ -3336,7 +3221,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Is Opening Entry", 
@@ -3366,7 +3250,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "C-Form Applicable", 
@@ -3394,7 +3277,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "C-Form No", 
@@ -3422,7 +3304,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -3449,7 +3330,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Posting Time", 
@@ -3478,7 +3358,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Remarks", 
@@ -3508,14 +3387,13 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Commission", 
    "length": 0, 
    "no_copy": 0, 
    "oldfieldtype": "Section Break", 
-   "options": "icon-group", 
+   "options": "fa fa-group", 
    "permlevel": 0, 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
@@ -3537,7 +3415,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Sales Partner", 
@@ -3567,7 +3444,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -3595,7 +3471,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Commission Rate (%)", 
@@ -3624,7 +3499,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Total Commission", 
@@ -3655,7 +3529,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Sales Team", 
@@ -3682,7 +3555,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Sales Team1", 
@@ -3714,13 +3586,12 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Recurring", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "icon-time", 
+   "options": "fa fa-time", 
    "permlevel": 0, 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
@@ -3742,7 +3613,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Settings", 
@@ -3772,7 +3642,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Is Recurring", 
@@ -3801,7 +3670,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Reference Document", 
@@ -3831,7 +3699,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Frequency", 
@@ -3861,7 +3728,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Repeat on Day of Month", 
@@ -3890,7 +3756,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "End Date", 
@@ -3918,7 +3783,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Submit on creation", 
@@ -3948,7 +3812,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Notify by email", 
@@ -3978,7 +3841,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Notification Email Address", 
@@ -4007,7 +3869,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Recurring Print Format", 
@@ -4036,7 +3897,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "This Document", 
@@ -4066,7 +3926,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "From Date", 
@@ -4095,7 +3954,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "To Date", 
@@ -4124,7 +3982,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Next Date", 
@@ -4151,7 +4008,6 @@
    "hidden": 1, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Against Income Account", 
@@ -4173,7 +4029,7 @@
  ], 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
- "icon": "icon-file-text", 
+ "icon": "fa fa-file-text", 
  "idx": 181, 
  "image_view": 0, 
  "in_create": 0, 
@@ -4183,7 +4039,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-01-18 13:21:13.226318", 
+ "modified": "2017-02-02 17:03:01.892758", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Sales Invoice", 
@@ -4199,7 +4055,6 @@
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
-   "is_custom": 0, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
@@ -4220,7 +4075,6 @@
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
-   "is_custom": 0, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
@@ -4241,7 +4095,6 @@
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
-   "is_custom": 0, 
    "permlevel": 1, 
    "print": 0, 
    "read": 1, 
@@ -4262,7 +4115,6 @@
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
-   "is_custom": 0, 
    "permlevel": 1, 
    "print": 0, 
    "read": 1, 
@@ -4282,6 +4134,6 @@
  "sort_order": "DESC", 
  "timeline_field": "customer", 
  "title_field": "title", 
- "track_changes": 1, 
+ "track_changes": 0, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/demo/setup/setup_data.py b/erpnext/demo/setup/setup_data.py
index 0c6a9b8..c664101 100644
--- a/erpnext/demo/setup/setup_data.py
+++ b/erpnext/demo/setup/setup_data.py
@@ -48,7 +48,7 @@
 		setup_complete({
 			"first_name": "Test",
 			"last_name": "User",
-			"email": "demo@erpnext.com",
+			"email": "test_demo@erpnext.com",
 			"company_tagline": 'Awesome Products and Services',
 			"password": "demo",
 			"fy_start_date": "2015-01-01",
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py
index 0e2dd1b..d60cd35 100644
--- a/erpnext/hr/doctype/salary_structure/salary_structure.py
+++ b/erpnext/hr/doctype/salary_structure/salary_structure.py
@@ -33,8 +33,13 @@
 def make_salary_slip(source_name, target_doc = None, employee = None, as_print = False, print_format = None):
 	def postprocess(source, target):
 		if employee:
+			employee_details = frappe.db.get_value("Employee", employee, 
+							["employee_name", "branch", "designation", "department"], as_dict=1)
 			target.employee = employee
-			target.employee_name = frappe.get_value("Employee",employee, "employee_name")
+			target.employee_name = employee_details.employee_name
+			target.branch = employee_details.branch
+			target.designation = employee_details.designation
+			target.department = employee_details.department
 		target.run_method('process_salary_structure')
 
 	doc = get_mapped_doc("Salary Structure", source_name, {
diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
index db5b66c..4692118 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
@@ -249,7 +249,7 @@
 				"wip_warehouse"			: "",
 				"fg_warehouse"			: d.warehouse,
 				"status"				: "Draft",
-				"project"			: frappe.db.get_value("Sales Order", d.sales_order, "project")
+				"project"				: frappe.db.get_value("Sales Order", d.sales_order, "project")
 			}
 
 			""" Club similar BOM and item for processing in case of Sales Orders """
@@ -345,53 +345,53 @@
 
 	def get_subitems(self,bom_wise_item_details, bom, parent_qty, include_sublevel, only_raw, supply_subs,non_stock_item=0):
 		items = frappe.db.sql("""
-			SELECT 
-				bom_item.item_code, 
+			SELECT
+				bom_item.item_code,
 				default_material_request_type,
 				ifnull(%(parent_qty)s * sum(bom_item.qty/ifnull(bom.quantity, 1)), 0) as qty,
-				item.is_sub_contracted_item as is_sub_contracted, 
+				item.is_sub_contracted_item as is_sub_contracted,
 				item.default_bom as default_bom,
-				bom_item.description as description,  
-				bom_item.stock_uom as stock_uom, 
-				item.min_order_qty as min_order_qty 
+				bom_item.description as description,
+				bom_item.stock_uom as stock_uom,
+				item.min_order_qty as min_order_qty
 			FROM
-				`tabBOM Item` bom_item, 
-				`tabBOM` bom, 
+				`tabBOM Item` bom_item,
+				`tabBOM` bom,
 				tabItem item
 			where
-				bom.name = bom_item.parent 
-				and bom.name = %(bom)s 
+				bom.name = bom_item.parent
+				and bom.name = %(bom)s
 				and bom_item.docstatus < 2
 				and bom_item.item_code = item.name
 			""" + ("and item.is_stock_item = 1", "")[non_stock_item] + """
 			group by bom_item.item_code""", {"bom": bom, "parent_qty": parent_qty}, as_dict=1)
-		
+
 		for d in items:
-			if ((d.default_material_request_type == "Purchase" 
-				and not (d.is_sub_contracted and only_raw and include_sublevel)) 
+			if ((d.default_material_request_type == "Purchase"
+				and not (d.is_sub_contracted and only_raw and include_sublevel))
 				or (d.default_material_request_type == "Manufacture" and not only_raw)):
 
 				if d.item_code in bom_wise_item_details:
 					bom_wise_item_details[d.item_code].qty = bom_wise_item_details[d.item_code].qty + d.qty
 				else:
 					bom_wise_item_details[d.item_code] = d
-			
+
 			if include_sublevel:
-				if ((d.default_material_request_type == "Purchase" and d.is_sub_contracted and supply_subs) 
+				if ((d.default_material_request_type == "Purchase" and d.is_sub_contracted and supply_subs)
 					or (d.default_material_request_type == "Manufacture")):
-					
+
 					my_qty = 0
 					projected_qty = self.get_item_projected_qty(d.item_code)
-					
+
 					if self.create_material_requests_for_all_required_qty:
 						my_qty = d.qty
 					elif (bom_wise_item_details[d.item_code].qty - d.qty) < projected_qty:
 						my_qty = bom_wise_item_details[d.item_code].qty - projected_qty
 					else:
 						my_qty = d.qty
-						
+
 					if my_qty > 0:
-						self.get_subitems(bom_wise_item_details, 
+						self.get_subitems(bom_wise_item_details,
 							d.default_bom, my_qty, include_sublevel, only_raw, supply_subs)
 
 		return bom_wise_item_details
@@ -408,12 +408,12 @@
 			item_list.append([item, self.item_dict[item][0][1], self.item_dict[item][0][2], total_qty])
 			item_qty = frappe.db.sql("""select warehouse, indented_qty, ordered_qty, actual_qty
 				from `tabBin` where item_code = %s""", item, as_dict=1)
-				
+
 			i_qty, o_qty, a_qty = 0, 0, 0
 			for w in item_qty:
 				i_qty, o_qty, a_qty = i_qty + flt(w.indented_qty), o_qty + \
 					flt(w.ordered_qty), a_qty + flt(w.actual_qty)
-					
+
 				item_list.append(['', '', '', '', w.warehouse, flt(w.indented_qty),
 					flt(w.ordered_qty), flt(w.actual_qty)])
 			if item_qty:
@@ -485,15 +485,15 @@
 	def get_item_projected_qty(self,item):
 		item_projected_qty = frappe.db.sql("""
 			select ifnull(sum(projected_qty),0) as qty
-			from `tabBin` 
+			from `tabBin`
 			where item_code = %(item_code)s and warehouse=%(warehouse)s
 		""", {
-			"item_code": item, 
+			"item_code": item,
 			"warehouse": self.purchase_request_for_warehouse
 		}, as_dict=1)
 
 		return item_projected_qty[0].qty
-		
+
 	def get_projected_qty(self):
 		items = self.item_dict.keys()
 		item_projected_qty = frappe.db.sql("""select item_code, sum(projected_qty)
diff --git a/erpnext/patches/v7_2/rename_evaluation_criteria.py b/erpnext/patches/v7_2/rename_evaluation_criteria.py
index 4239232..a45604f 100644
--- a/erpnext/patches/v7_2/rename_evaluation_criteria.py
+++ b/erpnext/patches/v7_2/rename_evaluation_criteria.py
@@ -2,23 +2,28 @@
 from frappe.model.utils.rename_field import rename_field
 
 def execute():
-    frappe.rename_doc("DocType", "Evaluation Criteria", "Assessment Criteria", force=True)
-    frappe.reload_doc("schools", "doctype", "assessment_criteria")
-    rename_field("Assessment Criteria", "evaluation_criteria", "assessment_criteria")
+	frappe.rename_doc("DocType", "Evaluation Criteria", "Assessment Criteria", force=True)
+	frappe.reload_doc("schools", "doctype", "assessment_criteria")
+	if 'evaluation_criteria' in frappe.db.get_table_columns('Assessment Criteria'):
+		rename_field("Assessment Criteria", "evaluation_criteria", "assessment_criteria")
 
-    frappe.rename_doc("DocType", "Assessment Evaluation Criteria", "Assessment Plan Criteria", force=True)
-    frappe.reload_doc("schools", "doctype", "assessment_plan_criteria")
-    rename_field("Assessment Plan Criteria", "evaluation_criteria", "assessment_criteria")
+	frappe.rename_doc("DocType", "Assessment Evaluation Criteria", "Assessment Plan Criteria", force=True)
+	frappe.reload_doc("schools", "doctype", "assessment_plan_criteria")
+	if 'evaluation_criteria' in frappe.db.get_table_columns('Assessment Plan'):
+		rename_field("Assessment Plan Criteria", "evaluation_criteria", "assessment_criteria")
 
-    frappe.reload_doc("schools", "doctype", "assessment_plan")
-    rename_field("Assessment Plan", "evaluation_criterias", "assessment_criteria")
-        
-    frappe.reload_doc("schools", "doctype", "assessment_result_detail")
-    rename_field("Assessment Result Detail", "evaluation_criteria", "assessment_criteria")
+	frappe.reload_doc("schools", "doctype", "assessment_plan")
+	rename_field("Assessment Plan", "evaluation_criterias", "assessment_criteria")
 
-    frappe.rename_doc("DocType", "Course Evaluation Criteria", "Course Assessment Criteria", force=True)
-    frappe.reload_doc("schools", "doctype", "course_assessment_criteria")
-    rename_field("Course Assessment Criteria", "evaluation_criteria", "assessment_criteria")
+	frappe.reload_doc("schools", "doctype", "assessment_result_detail")
+	if 'evaluation_criteria' in frappe.db.get_table_columns('Assessment Result Detail'):
+		rename_field("Assessment Result Detail", "evaluation_criteria", "assessment_criteria")
 
-    frappe.reload_doc("schools", "doctype", "course")
-    rename_field("Course", "evaluation_criterias", "assessment_criteria")
+	frappe.rename_doc("DocType", "Course Evaluation Criteria", "Course Assessment Criteria", force=True)
+	frappe.reload_doc("schools", "doctype", "course_assessment_criteria")
+	if 'evaluation_criteria' in frappe.db.get_table_columns('Course Assessment Criteria'):
+		rename_field("Course Assessment Criteria", "evaluation_criteria", "assessment_criteria")
+
+	frappe.reload_doc("schools", "doctype", "course")
+	if 'evaluation_criteria' in frappe.db.get_table_columns('Course'):
+		rename_field("Course", "evaluation_criterias", "assessment_criteria")
diff --git a/erpnext/projects/doctype/timesheet/timesheet_calendar.js b/erpnext/projects/doctype/timesheet/timesheet_calendar.js
index 0af1a6c..14f016a 100644
--- a/erpnext/projects/doctype/timesheet/timesheet_calendar.js
+++ b/erpnext/projects/doctype/timesheet/timesheet_calendar.js
@@ -4,7 +4,6 @@
 		"end": "end_date",
 		"name": "parent",
 		"id": "name",
-		"title": "name",
 		"allDay": "allDay",
 		"child_name": "name",
 		"title": "title"
diff --git a/erpnext/schools/doctype/assessment_criteria/assessment_criteria.json b/erpnext/schools/doctype/assessment_criteria/assessment_criteria.json
index dd6d5dd..990b22b 100644
--- a/erpnext/schools/doctype/assessment_criteria/assessment_criteria.json
+++ b/erpnext/schools/doctype/assessment_criteria/assessment_criteria.json
@@ -22,7 +22,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Assessment Criteria", 
@@ -42,7 +41,7 @@
   }, 
   {
    "allow_on_submit": 0, 
-   "bold": 0, 
+   "bold": 1, 
    "collapsible": 0, 
    "columns": 0, 
    "fieldname": "assessment_criteria_group", 
@@ -50,7 +49,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Assessment Criteria Group", 
@@ -80,7 +78,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-02-01 17:41:48.994388", 
+ "modified": "2017-02-03 05:53:39.248759", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Assessment Criteria", 
diff --git a/erpnext/schools/doctype/grading_scale/grading_scale.py b/erpnext/schools/doctype/grading_scale/grading_scale.py
index f7f6ba9..4abff96 100644
--- a/erpnext/schools/doctype/grading_scale/grading_scale.py
+++ b/erpnext/schools/doctype/grading_scale/grading_scale.py
@@ -5,6 +5,7 @@
 from __future__ import unicode_literals
 import frappe
 from frappe import _
+from frappe.utils import cint
 from frappe.model.document import Document
 
 class GradingScale(Document):
@@ -12,8 +13,8 @@
 		thresholds = []
 		for d in self.intervals:
 			if d.threshold in thresholds:
-				frappe.throw(_("Treshold {0}% appears more than once.".format(d.threshold)))
+				frappe.throw(_("Treshold {0}% appears more than once".format(d.threshold)))
 			else:
-				thresholds.append(d.threshold)
+				thresholds.append(cint(d.threshold))
 		if 0 not in thresholds:
 			frappe.throw(_("Please define grade for treshold 0%"))
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student/student.json b/erpnext/schools/doctype/student/student.json
index 50efdc1..9595dfa 100644
--- a/erpnext/schools/doctype/student/student.json
+++ b/erpnext/schools/doctype/student/student.json
@@ -22,7 +22,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "First Name", 
@@ -50,7 +49,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Middle Name", 
@@ -78,7 +76,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Last Name", 
@@ -106,7 +103,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -133,7 +129,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Naming Series", 
@@ -162,7 +157,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Student Email Address", 
@@ -190,7 +184,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Student Mobile Number", 
@@ -220,7 +213,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
    "label": "Joining Date", 
@@ -248,7 +240,6 @@
    "hidden": 1, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Image", 
@@ -278,7 +269,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Personal Details", 
@@ -306,7 +296,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Date of Birth", 
@@ -334,7 +323,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Blood Group", 
@@ -363,7 +351,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -390,7 +377,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Gender", 
@@ -419,7 +405,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Nationality", 
@@ -448,7 +433,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Student Applicant", 
@@ -477,7 +461,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Guardian Details", 
@@ -505,7 +488,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Guardians", 
@@ -534,7 +516,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Home Address", 
@@ -562,7 +543,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Address Line 1", 
@@ -590,7 +570,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Address Line 2", 
@@ -618,7 +597,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Pincode", 
@@ -646,7 +624,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -673,7 +650,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "City", 
@@ -701,7 +677,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "State", 
@@ -729,7 +704,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Sibling Details", 
@@ -758,7 +732,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Siblings", 
@@ -788,7 +761,6 @@
    "hidden": 1, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Title", 
@@ -819,7 +791,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-01-27 13:19:55.693540", 
+ "modified": "2017-02-03 05:07:48.915706", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student", 
@@ -855,7 +827,7 @@
    "email": 1, 
    "export": 1, 
    "if_owner": 0, 
-   "import": 0, 
+   "import": 1, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
diff --git a/erpnext/schools/doctype/student/student.py b/erpnext/schools/doctype/student/student.py
index a34bb6a..b660bb3 100644
--- a/erpnext/schools/doctype/student/student.py
+++ b/erpnext/schools/doctype/student/student.py
@@ -5,9 +5,9 @@
 from __future__ import unicode_literals
 import frappe
 from frappe.model.document import Document
+from frappe import _
 
 class Student(Document):
-
 	def validate(self):
 		self.title = " ".join(filter(None, [self.first_name, self.middle_name, self.last_name]))
 
@@ -19,7 +19,7 @@
 		"""Validates if the Student Applicant is Unique"""
 		student = frappe.db.sql("select name from `tabStudent` where student_applicant=%s and name!=%s", (self.student_applicant, self.name))
 		if student:
-			frappe.throw("Student {0} exist against student applicant {1}".format(student[0][0], self.student_applicant))
+			frappe.throw(_("Student {0} exist against student applicant {1}").format(student[0][0], self.student_applicant))
 
 	def update_applicant_status(self):
 		"""Updates Student Applicant status to Admitted"""
@@ -28,10 +28,9 @@
 
 def get_timeline_data(doctype, name):
 	'''Return timeline for attendance'''
-	return dict(frappe.db.sql('''select unix_timestamp(cs.schedule_date), count(*)
-		from `tabCourse Schedule` as cs , `tabStudent Attendance` as sa where
-			sa.course_schedule = cs.name
-			and sa.student=%s
-			and cs.schedule_date > date_sub(curdate(), interval 1 year)
+	return dict(frappe.db.sql('''select unix_timestamp(`date`), count(*)
+		from `tabStudent Attendance` where
+			student=%s
+			and `date` > date_sub(curdate(), interval 1 year)
 			and status = 'Present'
-			group by cs.schedule_date''', name))
+			group by date''', name))
diff --git a/erpnext/schools/doctype/student_attendance/student_attendance.py b/erpnext/schools/doctype/student_attendance/student_attendance.py
index e2d01b5..8e806e4 100644
--- a/erpnext/schools/doctype/student_attendance/student_attendance.py
+++ b/erpnext/schools/doctype/student_attendance/student_attendance.py
@@ -6,11 +6,15 @@
 import frappe
 from frappe.model.document import Document
 from frappe import _
+from erpnext.schools.api import get_student_batch_students, get_student_group_students
+
 
 class StudentAttendance(Document):
 	def validate(self):
 		self.validate_date()
 		self.validate_mandatory()
+		self.validate_course_schedule()
+		self.validate_student()
 		self.validate_duplication()
 		
 	def validate_date(self):
@@ -21,9 +25,27 @@
 		if not (self.student_batch or self.course_schedule):
 			frappe.throw(_("""Student Batch or Course Schedule is mandatory"""))
 	
+	def validate_course_schedule(self):
+		if self.course_schedule:
+			self.student_batch = frappe.db.get_value("Course Schedule", self.course_schedule, "student_batch")
+	
+	def validate_student(self):
+		if self.course_schedule:
+			student_group = frappe.db.get_value("Course Schedule", self.course_schedule, "student_group")
+			student_group_students = []
+			for d in get_student_group_students(student_group):
+				student_group_students.append(d.student)
+			if student_group and self.student not in student_group_students:
+				frappe.throw(_("""Student {0}: {1} does not belong to Student Group {2}""".format(self.student, self.student_name, student_group)))
+		else:
+			student_batch_students = []
+			for d in get_student_batch_students(self.student_batch):
+				student_batch_students.append(d.student)
+			if self.student not in student_batch_students:
+				frappe.throw(_("""Student {0}: {1} does not belong to Student Batch {2}""".format(self.student, self.student_name, self.student_batch)))
+
 	def validate_duplication(self):
 		"""Check if the Attendance Record is Unique"""
-		
 		attendance_records=None
 		if self.course_schedule:
 			attendance_records= frappe.db.sql("""select name from `tabStudent Attendance` where \
diff --git a/erpnext/schools/doctype/student_batch/student_batch.json b/erpnext/schools/doctype/student_batch/student_batch.json
index f571d9d..4909ff0 100644
--- a/erpnext/schools/doctype/student_batch/student_batch.json
+++ b/erpnext/schools/doctype/student_batch/student_batch.json
@@ -1,7 +1,7 @@
 {
  "allow_copy": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
+ "allow_import": 1, 
+ "allow_rename": 1, 
  "autoname": "", 
  "beta": 0, 
  "creation": "2016-07-21 15:49:53.776461", 
@@ -22,7 +22,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Student Batch Name", 
@@ -51,7 +50,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 1, 
    "label": "Academic Year", 
@@ -81,7 +79,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Active", 
@@ -109,7 +106,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "length": 0, 
@@ -136,7 +132,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 1, 
    "label": "Program", 
@@ -165,7 +160,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 1, 
    "label": "Academic Term", 
@@ -194,7 +188,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Students", 
@@ -222,7 +215,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Students", 
@@ -251,7 +243,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Instructors", 
@@ -279,7 +270,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Instructors", 
@@ -309,7 +299,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-12-01 13:18:12.024001", 
+ "modified": "2017-02-03 05:19:35.037148", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Batch", 
@@ -325,8 +315,7 @@
    "email": 1, 
    "export": 1, 
    "if_owner": 0, 
-   "import": 0, 
-   "is_custom": 0, 
+   "import": 1, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
@@ -347,7 +336,6 @@
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
-   "is_custom": 0, 
    "permlevel": 0, 
    "print": 0, 
    "read": 1, 
@@ -365,5 +353,6 @@
  "sort_field": "modified", 
  "sort_order": "DESC", 
  "title_field": "", 
+ "track_changes": 0, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_batch_student/student_batch_student.json b/erpnext/schools/doctype/student_batch_student/student_batch_student.json
index 558281b..3558cc8 100644
--- a/erpnext/schools/doctype/student_batch_student/student_batch_student.json
+++ b/erpnext/schools/doctype/student_batch_student/student_batch_student.json
@@ -20,7 +20,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
    "label": "Student", 
@@ -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, 
    "length": 0, 
@@ -76,13 +74,12 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
    "label": "Student Name", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "", 
+   "options": "student.title", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -106,7 +103,6 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
    "label": "Active", 
@@ -135,7 +131,7 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-01-27 14:47:21.125366", 
+ "modified": "2017-02-03 05:26:35.518004", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Batch Student", 
diff --git a/erpnext/schools/doctype/student_group/student_group.py b/erpnext/schools/doctype/student_group/student_group.py
index f604773..2f27957 100644
--- a/erpnext/schools/doctype/student_group/student_group.py
+++ b/erpnext/schools/doctype/student_group/student_group.py
@@ -7,6 +7,7 @@
 from frappe.model.document import Document
 from frappe import _
 from erpnext.schools.utils import validate_duplicate_student
+from erpnext.schools.api import get_student_batch_students
 
 class StudentGroup(Document):
 	def autoname(self):
@@ -29,6 +30,8 @@
 	def validate(self):
 		self.validate_strength()
 		self.validate_student_name()
+		if self.student_batch:
+			self.validate_student_batch()
 		validate_duplicate_student(self.students)
 
 	def validate_strength(self):
@@ -39,4 +42,10 @@
 		for d in self.students:
 			d.student_name = frappe.db.get_value("Student", d.student, "title")
 	
-	
\ No newline at end of file
+	def validate_student_batch(self):
+		student_batch_students = []
+		for d in get_student_batch_students(self.student_batch):
+			student_batch_students.append(d.student)
+		for d in self.students:
+			if d.student not in student_batch_students:
+				frappe.throw(_("""Student {0}: {1} does not belong to Student Batch {2}""".format(d.student, d.student_name, self.student_batch)))
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index 8a4a47c..f01e484 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -4,11 +4,23 @@
 {% include 'erpnext/selling/sales_common.js' %}
 
 frappe.ui.form.on("Sales Order", {
+	setup: function(frm) {
+		$.extend(frm.cscript, new erpnext.selling.SalesOrderController({frm: frm}));
+	},
 	onload: function(frm) {
 		erpnext.queries.setup_queries(frm, "Warehouse", function() {
 			return erpnext.queries.warehouse(frm.doc);
 		});
 
+		frm.set_query('project', function(doc, cdt, cdn) {
+			return {
+				query: "erpnext.controllers.queries.get_project_name",
+				filters: {
+					'customer': doc.customer
+				}
+			}
+		});
+
 		// formatter for material request item
 		frm.set_indicator_formatter('item_code',
 			function(doc) { return (doc.qty<=doc.delivered_qty) ? "green" : "orange" })
@@ -17,6 +29,7 @@
 
 erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend({
 	refresh: function(doc, dt, dn) {
+		var me = this;
 		this._super();
 		var allow_purchase = false;
 		var allow_delivery = false;
@@ -24,8 +37,8 @@
 		if(doc.docstatus==1) {
 			if(doc.status != 'Closed') {
 
-				for (var i in cur_frm.doc.items) {
-					var item = cur_frm.doc.items[i];
+				for (var i in this.frm.doc.items) {
+					var item = this.frm.doc.items[i];
 					if(item.delivered_by_supplier === 1 || item.supplier){
 						if(item.qty > flt(item.ordered_qty)
 							&& item.qty > flt(item.delivered_qty)) {
@@ -47,55 +60,69 @@
 				if (this.frm.has_perm("submit")) {
 					// close
 					if(flt(doc.per_delivered, 2) < 100 || flt(doc.per_billed) < 100) {
-							cur_frm.add_custom_button(__('Close'), this.close_sales_order, __("Status"))
+							this.frm.add_custom_button(__('Close'),
+								function() { me.close_sales_order() }, __("Status"))
 						}
 				}
 
 				// delivery note
 				if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 && allow_delivery) {
-					cur_frm.add_custom_button(__('Delivery'), this.make_delivery_note, __("Make"));
-					cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
+					this.frm.add_custom_button(__('Delivery'),
+						function() { me.make_delivery_note() }, __("Make"));
+					this.frm.add_custom_button(__('Production Order'),
+						function() { me.make_production_order() }, __("Make"));
+
+					this.frm.page.set_inner_btn_group_as_primary(__("Make"));
 				}
 
 				// sales invoice
 				if(flt(doc.per_billed, 2) < 100) {
-					cur_frm.add_custom_button(__('Invoice'), this.make_sales_invoice, __("Make"));
+					this.frm.add_custom_button(__('Invoice'),
+						function() { me.make_sales_invoice() }, __("Make"));
 				}
 
 				// material request
 				if(!doc.order_type || ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1
 					&& flt(doc.per_delivered, 2) < 100) {
-						cur_frm.add_custom_button(__('Material Request'), this.make_material_request, __("Make"));
+						this.frm.add_custom_button(__('Material Request'),
+							function() { me.make_material_request() }, __("Make"));
 				}
 
 				// make purchase order
 				if(flt(doc.per_delivered, 2) < 100 && allow_purchase) {
-					cur_frm.add_custom_button(__('Purchase Order'), cur_frm.cscript.make_purchase_order, __("Make"));
+					this.frm.add_custom_button(__('Purchase Order'),
+						function() { me.make_purchase_order() }, __("Make"));
 				}
 
+				// payment request
 				if(flt(doc.per_billed)==0) {
-					cur_frm.add_custom_button(__('Payment Request'), this.make_payment_request, __("Make"));
-					cur_frm.add_custom_button(__('Payment'), cur_frm.cscript.make_payment_entry, __("Make"));
+					this.frm.add_custom_button(__('Payment Request'),
+						function() { me.make_payment_request() }, __("Make"));
+					this.frm.add_custom_button(__('Payment'),
+						function() { me.make_payment_entry() }, __("Make"));
 				}
 
 				// maintenance
 				if(flt(doc.per_delivered, 2) < 100 &&
 						["Sales", "Shopping Cart"].indexOf(doc.order_type)===-1) {
-					cur_frm.add_custom_button(__('Maintenance Visit'), this.make_maintenance_visit, __("Make"));
-					cur_frm.add_custom_button(__('Maintenance Schedule'), this.make_maintenance_schedule, __("Make"));
+					this.frm.add_custom_button(__('Maintenance Visit'),
+						function() { me.make_maintenance_visit() }, __("Make"));
+					this.frm.add_custom_button(__('Maintenance Schedule'),
+						function() { me.make_maintenance_schedule() }, __("Make"));
 				}
 
-
 			} else {
 				if (this.frm.has_perm("submit")) {
 					// un-close
-					cur_frm.add_custom_button(__('Re-open'), cur_frm.cscript['Unclose Sales Order'], __("Status"));
+					this.frm.add_custom_button(__('Re-open'), function() {
+						me.frm.cscript.update_status('Re-open', 'Draft')
+					}, __("Status"));
 				}
 			}
 		}
 
 		if (this.frm.doc.docstatus===0) {
-			cur_frm.add_custom_button(__('Quotation'),
+			this.frm.add_custom_button(__('Quotation'),
 				function() {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.selling.doctype.quotation.quotation.make_sales_order",
@@ -103,9 +130,9 @@
 						get_query_filters: {
 							docstatus: 1,
 							status: ["!=", "Lost"],
-							order_type: cur_frm.doc.order_type,
-							customer: cur_frm.doc.customer || undefined,
-							company: cur_frm.doc.company
+							order_type: me.frm.doc.order_type,
+							customer: me.frm.doc.customer || undefined,
+							company: me.frm.doc.company
 						}
 					})
 				}, __("Get items from"));
@@ -114,6 +141,82 @@
 		this.order_type(doc);
 	},
 
+	make_production_order() {
+		var me = this;
+		this.frm.call({
+			doc: this.frm.doc,
+			method: 'get_production_order_items',
+			callback: function(r) {
+				if(!r.message.every(function(d) { return !!d.bom })) {
+					frappe.msgprint({
+						title: __('Production Order not created'),
+						message: __('No Items with Bill of Materials to Manufacture'),
+						indicator: 'orange'
+					});
+					return;
+				}
+				else if(!r.message.every(function(d) { return !!d.pending_qty })) {
+					frappe.msgprint({
+						title: __('Production Order not created'),
+						message: __('Production Order already created for all items with BOM'),
+						indicator: 'orange'
+					});
+					return;
+				} else {
+					var fields = [
+						{fieldtype:'Table', fieldname: 'items',
+							description: __('Select BOM and Qty for Production'),
+							fields: [
+								{fieldtype:'Read Only', fieldname:'item_code',
+									label: __('Item Code'), in_list_view:1},
+								{fieldtype:'Link', fieldname:'bom', options: 'BOM',
+									label: __('Select BOM'), in_list_view:1, get_query: function(doc) {
+										return {filters: {item: doc.item_code}};
+									}},
+								{fieldtype:'Float', fieldname:'pending_qty',
+									label: __('Qty'), in_list_view:1},
+							],
+							get_data: function() {
+								return r.message
+							}
+						}
+					]
+					var d = new frappe.ui.Dialog({
+						title: __('Select Items to Manufacture'),
+						fields: fields,
+						primary_action: function() {
+							data = d.get_values();
+							me.frm.call({
+								method: 'make_production_orders',
+								args: {
+									items: data,
+									company: me.frm.doc.company,
+									sales_order: me.frm.docname,
+									project: me.frm.project
+								},
+								freeze: true,
+								callback: function(r) {
+									if(r.message) {
+										frappe.msgprint({
+											message: __('Production Orders Created: {0}',
+												[r.message.map(function(d) {
+													return repl('<a href="#Form/Production Order/%(name)s">%(name)s</a>', {name:d})
+												}).join(', ')]),
+											indicator: 'green'
+										})
+									}
+									d.hide();
+								}
+							});
+						},
+						primary_action_label: __('Make')
+					});
+					d.show();
+				}
+			}
+		});
+	},
+
 	order_type: function() {
 		this.frm.toggle_reqd("delivery_date", this.frm.doc.order_type == "Sales");
 	},
@@ -125,39 +228,40 @@
 	make_material_request: function() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.selling.doctype.sales_order.sales_order.make_material_request",
-			frm: cur_frm
+			frm: this.frm
 		})
 	},
 
 	make_delivery_note: function() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note",
-			frm: cur_frm
+			frm: this.frm
 		})
 	},
 
 	make_sales_invoice: function() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice",
-			frm: cur_frm
+			frm: this.frm
 		})
 	},
 
 	make_maintenance_schedule: function() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_schedule",
-			frm: cur_frm
+			frm: this.frm
 		})
 	},
 
 	make_maintenance_visit: function() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_visit",
-			frm: cur_frm
+			frm: this.frm
 		})
 	},
 
 	make_purchase_order: function(){
+		var me = this;
 		var dialog = new frappe.ui.Dialog({
 			title: __("For Supplier"),
 			fields: [
@@ -165,7 +269,7 @@
 					"get_query": function () {
 						return {
 							query:"erpnext.selling.doctype.sales_order.sales_order.get_supplier",
-							filters: {'parent': cur_frm.doc.name}
+							filters: {'parent': me.frm.doc.name}
 						}
 					}, "reqd": 1 },
 				{"fieldtype": "Button", "label": __("Make Purchase Order"), "fieldname": "make_purchase_order", "cssClass": "btn-primary"},
@@ -180,7 +284,7 @@
 				type: "GET",
 				method: "erpnext.selling.doctype.sales_order.sales_order.make_purchase_order_for_drop_shipment",
 				args: {
-					"source_name": cur_frm.doc.name,
+					"source_name": me.frm.doc.name,
 					"for_supplier": args.supplier
 				},
 				freeze: true,
@@ -195,44 +299,25 @@
 		dialog.show();
 	},
 	close_sales_order: function(){
-		cur_frm.cscript.update_status("Close", "Closed")
+		this.frm.cscript.update_status("Close", "Closed")
+	},
+	update_status: function(label, status){
+		var doc = this.frm.doc;
+		frappe.ui.form.is_saving = true;
+		frappe.call({
+			method: "erpnext.selling.doctype.sales_order.sales_order.update_status",
+			args: {status: status, name: doc.name},
+			callback: function(r){
+				this.frm.reload_doc();
+			},
+			always: function() {
+				frappe.ui.form.is_saving = false;
+			}
+		});
+	},
+	on_submit: function(doc, cdt, cdn) {
+		if(cint(frappe.boot.notification_settings.sales_order)) {
+			this.frm.email_doc(frappe.boot.notification_settings.sales_order_message);
+		}
 	}
-
 });
-
-// for backward compatibility: combine new and previous states
-$.extend(cur_frm.cscript, new erpnext.selling.SalesOrderController({frm: cur_frm}));
-
-cur_frm.fields_dict['project'].get_query = function(doc, cdt, cdn) {
-	return {
-		query: "erpnext.controllers.queries.get_project_name",
-		filters: {
-			'customer': doc.customer
-		}
-	}
-}
-
-cur_frm.cscript.update_status = function(label, status){
-	var doc = cur_frm.doc;
-	frappe.ui.form.is_saving = true;
-	frappe.call({
-		method: "erpnext.selling.doctype.sales_order.sales_order.update_status",
-		args: {status: status, name: doc.name},
-		callback: function(r){
-			cur_frm.reload_doc();
-		},
-		always: function() {
-			frappe.ui.form.is_saving = false;
-		}
-	});
-}
-
-cur_frm.cscript['Unclose Sales Order'] = function() {
-	cur_frm.cscript.update_status('Re-open', 'Draft')
-}
-
-cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
-	if(cint(frappe.boot.notification_settings.sales_order)) {
-		cur_frm.email_doc(frappe.boot.notification_settings.sales_order_message);
-	}
-};
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index acae0e5..fdaadd8 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -304,6 +304,24 @@
 			self.indicator_color = "green"
 			self.indicator_title = _("Paid")
 
+	def get_production_order_items(self):
+		'''Returns items with BOM that already do not have a linked production order'''
+		items = []
+		for i in self.packed_items or self.items:
+			bom = frappe.get_all('BOM', dict(item=i.item_code, is_active=True),
+					order_by='is_default desc')
+			bom = bom[0].name if bom else None
+			items.append(dict(
+				item_code= i.item_code,
+				bom = bom,
+				warehouse = i.warehouse,
+				pending_qty= i.qty - flt(frappe.db.sql('''select sum(qty) from `tabProduction Order`
+					where production_item=%s and sales_order=%s''', (i.item_code, self.name))[0][0])
+			))
+
+		return items
+
+
 	def on_recurring(self, reference_doc):
 		mcount = month_map[reference_doc.recurring_type]
 		self.set("delivery_date", get_next_date(reference_doc.delivery_date, mcount,
@@ -442,7 +460,7 @@
 		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 \
@@ -653,6 +671,27 @@
 		})
 
 @frappe.whitelist()
+def make_production_orders(items, sales_order, company, project=None):
+	'''Make Production Orders against the given Sales Order for the given `items`'''
+	items = json.loads(items).get('items')
+	out = []
+
+	for i in items:
+		production_order = frappe.get_doc(dict(
+			doctype='Production Order',
+			production_item=i['item_code'],
+			bom_no=i['bom'],
+			qty=i['pending_qty'],
+			company=company,
+			sales_order=sales_order,
+			project=project,
+			fg_warehouse=i['warehouse']
+		)).insert()
+		out.append(production_order)
+
+	return [p.name for p in out]
+
+@frappe.whitelist()
 def update_status(status, name):
 	so = frappe.get_doc("Sales Order", name)
 	so.update_status(status)
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index b410802..37f9b68 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -41,6 +41,10 @@
 				}
 			}
 		}
+
+		this.frm.set_indicator_formatter('item_code',
+			function(doc) { return (doc.qty<=doc.actual_qty) ? "green" : "orange" })
+
 	},
 
 	onload_post_render: function() {
diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py
index f2d8bd5..e5c6ee1 100644
--- a/erpnext/support/doctype/issue/issue.py
+++ b/erpnext/support/doctype/issue/issue.py
@@ -81,9 +81,15 @@
 	st.save()
 
 def auto_close_tickets():
-	frappe.db.sql("""update `tabIssue` set status = 'Closed'
-		where status = 'Replied'
-		and date_sub(curdate(),interval 15 Day) > modified""")
+	issues = frappe.db.get_all("Issue", filters={
+		"status": "Replied",
+		"modified": ("<", "date_sub(curdate(),interval 7 Day)")
+	}, fields=["name"])
+
+	for issue in issues:
+		doc = frappe.get_doc("Issue", issue.get("name"))
+		doc.status = "Closed"
+		doc.save(ignore_permissions=True)
 
 @frappe.whitelist()
 def set_multiple_status(names, status):