Merge pull request #7737 from KanchanChauhan/project-percentage

[Fix] Project % Completed set to 0 if no tasks
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/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">&ndash; {%= 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">&ndash; {%= 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/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"))