Merge branch 'master' into develop
diff --git a/erpnext/config/healthcare.py b/erpnext/config/healthcare.py
index f4bf4f7..37d95ad 100644
--- a/erpnext/config/healthcare.py
+++ b/erpnext/config/healthcare.py
@@ -11,7 +11,7 @@
 				{
 					"type": "doctype",
 					"name": "Patient Appointment",
-					"description": _("Patient Appointment"),
+					"label": _("Patient Appointment"),
 				},
 				{
 					"type": "doctype",
@@ -43,7 +43,7 @@
 				{
 					"type": "doctype",
 					"name": "Lab Test",
-					"description": _("Results"),
+					"label": _("Lab Test"),
 				},
 				{
 					"type": "doctype",
@@ -53,7 +53,8 @@
 				{
 					"type": "report",
 					"name": "Lab Test Report",
-					"is_query_report": True
+					"is_query_report": True,
+					"label": _("Lab Test Report"),
 				}
 			]
 		},
@@ -69,7 +70,7 @@
 				{
 					"type": "doctype",
 					"name": "Physician",
-					"label": "Physician",
+					"label": _("Physician"),
 				},
 				{
 					"type": "doctype",
@@ -100,57 +101,57 @@
 				{
 					"type": "doctype",
 					"name": "Medical Department",
-					"label": "Medical Department"
+					"label": _("Medical Department"),
 				},
 				{
 					"type": "doctype",
 					"name": "Appointment Type",
-					"description": _("Appointment Type Master"),
+					"label": _("Appointment Type"),
 				},
 				{
 					"type": "doctype",
 					"name": "Prescription Dosage",
-					"description": _("Prescription Dosage")
+					"label": _("Prescription Dosage")
 				},
 				{
 					"type": "doctype",
 					"name": "Prescription Duration",
-					"description": _("Prescription Period")
+					"label": _("Prescription Duration")
 				},
 				{
 					"type": "doctype",
 					"name": "Complaint",
-					"description": _("Complaint")
+					"label": _("Complaint")
 				},
 				{
 					"type": "doctype",
 					"name": "Diagnosis",
-					"description": _("Diagnosis")
+					"label": _("Diagnosis")
 				},
 				{
 					"type": "doctype",
 					"name": "Lab Test Sample",
-					"description": _("Test Sample Master."),
+					"label": _("Test Sample."),
 				},
 				{
 					"type": "doctype",
 					"name": "Lab Test UOM",
-					"description": _("Lab Test UOM.")
+					"label": _("Lab Test UOM.")
 				},
 				{
 					"type": "doctype",
 					"name": "Antibiotic",
-					"description": _("Antibiotic.")
+					"label": _("Antibiotic.")
 				},
 				{
 					"type": "doctype",
 					"name": "Sensitivity",
-					"description": _("Sensitivity Naming.")
+					"label": _("Sensitivity Naming.")
 				},
 				{
 					"type": "doctype",
 					"name": "Lab Test Template",
-					"description": _("Lab Test Configurations.")
+					"label": _("Lab Test Template.")
 				}
 			]
 		}
diff --git a/erpnext/docs/user/manual/en/customize-erpnext/custom-doctype.md b/erpnext/docs/user/manual/en/customize-erpnext/custom-doctype.md
index 33a5857..93abb3e 100644
--- a/erpnext/docs/user/manual/en/customize-erpnext/custom-doctype.md
+++ b/erpnext/docs/user/manual/en/customize-erpnext/custom-doctype.md
@@ -36,7 +36,7 @@
 1. Actions (button)
 1. Attachments or Images
 
-<img alt="Doc fields" class="screenshot" src="/docs/assets/img/setup/customize/doctype-all-fields.png">
+<img alt="Doc fields" class="screenshot" src="/docs/assets/img/setup/customize/Doctype-all-fields.png">
 
 When you add fields, you need to enter the **Type**. **Label** is optional for Section Break and Column Break. **Name** (`fieldname`) is the name of the database table column.
 
@@ -52,13 +52,13 @@
 
 In this table, you should select roles and define permission roles for them for this Doctype.
 
-<img alt="Doctype Permissions" class="screenshot" src="/docs/assets/img/setup/customize/doctype-permissions.png">
+<img alt="Doctype Permissions" class="screenshot" src="/docs/assets/img/setup/customize/Doctype-permissions.png">
 
 #### Save DocType
 
 On saving doctype, you will get pop-up to provide name for this Doctype.
 
-<img alt="Doctype Save" class="screenshot" src="/docs/assets/img/setup/customize/doctype-save.png">
+<img alt="Doctype Save" class="screenshot" src="/docs/assets/img/setup/customize/Doctype-save.png">
 
 #### DocType in System
 
@@ -67,12 +67,12 @@
 
 `Human Resource > Document > Book`
 
-<img alt="Doctype List" class="screenshot" src="/docs/assets/img/setup/customize/doctype-list-view.png">
+<img alt="Doctype List" class="screenshot" src="/docs/assets/img/setup/customize/Doctype-list-view.png">
 
 #### Book master
 
 Using the fields entered, following is the master one book.
 
-<img alt="Doctype Form" class="screenshot" src="/docs/assets/img/setup/customize/doctype-book-added.png">
+<img alt="Doctype Form" class="screenshot" src="/docs/assets/img/setup/customize/Doctype-book-added.png">
 
 {next}
diff --git a/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.js b/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.js
index 19b32a9..cea0761 100644
--- a/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.js
+++ b/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.js
@@ -77,7 +77,7 @@
 		() => frappe.set_route('List', 'Student Attendance/List'),
 		() => frappe.timeout(1),
 		() => {
-			assert.equal(($('div.list-item').size() - 1), count, "Attendance list created");
+			assert.equal(cur_list.data.length, count, "Attendance list created");
 		},
 
 		() => done()
diff --git a/erpnext/healthcare/doctype/consultation/consultation.js b/erpnext/healthcare/doctype/consultation/consultation.js
index 8ed01c3..89b8861 100644
--- a/erpnext/healthcare/doctype/consultation/consultation.js
+++ b/erpnext/healthcare/doctype/consultation/consultation.js
@@ -28,7 +28,6 @@
 						age = calculate_age(data.message.dob);
 					}
 					frappe.model.set_value(frm.doctype,frm.docname, "patient_age", age);
-					show_details(data.message);
 				}
 			});
 		}
@@ -144,58 +143,6 @@
 	frappe.new_doc("Vital Signs");
 };
 
-var show_details = function(data){
-	var personal_details = "";
-	var age = null;
-	if(data.dob){
-		age = calculate_age(data.dob);
-		personal_details += "<br><b>Age :</b> " + age;
-	}
-	if(data.sex) personal_details += "<br><b>Gender :</b> " + data.sex;
-	if(data.blood_group) personal_details += "<br><b>Blood group : </b> " + data.blood_group;
-	if(data.occupation) personal_details += "<br><b>Occupation :</b> " + data.occupation;
-	if(data.email) personal_details += "<br><b>Email :</b> " + data.email;
-	if(data.mobile) personal_details += "<br><b>Mobile :</b> " + data.mobile;
-
-	if(personal_details){
-		personal_details = "<div style='padding-left:10px; font-size:13px;' align='left'></br><b class='text-muted'>Personal Details</b>" + personal_details + "</div>";
-	}
-
-	var details = "";
-	if(data.allergies) details +=  "<br><br><b>Allergies : </b> "+  data.allergies;
-	if(data.medication) details +=  "<br><b>Medication : </b> "+  data.medication;
-	if(data.alcohol_current_use) details +=  "<br><br><b>Alcohol use : </b> "+  data.alcohol_current_use;
-	if(data.alcohol_past_use) details +=  "<br><b>Alcohol past use : </b> "+  data.alcohol_past_use;
-	if(data.tobacco_current_use) details +=  "<br><b>Tobacco use : </b> "+  data.tobacco_current_use;
-	if(data.tobacco_past_use) details +=  "<br><b>Tobacco past use : </b> "+  data.tobacco_past_use;
-	if(data.medical_history) details +=  "<br><br><b>Medical history : </b> "+  data.medical_history;
-	if(data.surgical_history) details +=  "<br><b>Surgical history : </b> "+  data.surgical_history;
-	if(data.surrounding_factors) details +=  "<br><br><b>Occupational hazards : </b> "+  data.surrounding_factors;
-	if(data.other_risk_factors) details += "<br><b>Other risk factors : </b> " + data.other_risk_factors;
-	if(data.patient_details) details += "<br><br><b>More info : </b> " + data.patient_details;
-
-	if(details){
-		details = "<div style='padding-left:10px; font-size:13px;' align='left'></br><b class='text-muted'>Patient Details</b>" + details + "</div>";
-	}
-
-	var vitals = "";
-	if(data.temperature) vitals += "<br><b>Temperature :</b> " + data.temperature;
-	if(data.pulse) vitals += ", <b>Pulse :</b> " + data.pulse;
-	if(data.respiratory_rate) vitals += ", <b>Respiratory Rate :</b> " + data.respiratory_rate;
-	if(data.bp) vitals += ", <b>BP :</b> " + data.bp;
-	if(data.bmi) vitals += "<br><b>BMI :</b> " + data.bmi;
-	if(data.nutrition_note) vitals += " (" + data.nutrition_note + ")";
-	if(data.height) vitals += ", <b>Height :</b> " + data.height;
-	if(data.weight) vitals += ", <b>Weight :</b> " + data.weight;
-	if(data.signs_date) vitals += "<br><b>Date :</b> " + data.signs_date;
-
-	if(vitals){
-		vitals = "<div style='padding-left:10px; font-size:13px;' align='left'></br><b class='text-muted'>Vital Signs</b>" + vitals + "<br></div>";
-	}
-	details = personal_details + vitals + details;
-	cur_frm.fields_dict.patient_details_html.$wrapper.html(details);
-};
-
 frappe.ui.form.on("Consultation", "appointment", function(frm){
 	if(frm.doc.appointment){
 		frappe.call({
@@ -266,7 +213,6 @@
 				}
 				frappe.model.set_value(frm.doctype,frm.docname, "patient_age", age);
 				frappe.model.set_value(frm.doctype,frm.docname, "patient_sex", data.message.sex);
-				if(frm.doc.__islocal) show_details(data.message);
 			}
 		});
 	}
diff --git a/erpnext/healthcare/doctype/consultation/consultation.json b/erpnext/healthcare/doctype/consultation/consultation.json
index 1eff21d..184f484 100644
--- a/erpnext/healthcare/doctype/consultation/consultation.json
+++ b/erpnext/healthcare/doctype/consultation/consultation.json
@@ -450,65 +450,6 @@
    "bold": 0, 
    "collapsible": 1, 
    "columns": 0, 
-   "fieldname": "patient_details", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Patient Details", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "patient_details_html", 
-   "fieldtype": "HTML", 
-   "hidden": 0, 
-   "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, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 1, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 1, 
-   "columns": 0, 
    "fieldname": "sb_symptoms", 
    "fieldtype": "Section Break", 
    "hidden": 0, 
@@ -1004,7 +945,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-11-22 14:03:30.434304", 
+ "modified": "2017-12-28 11:25:35.256848", 
  "modified_by": "Administrator", 
  "module": "Healthcare", 
  "name": "Consultation", 
@@ -1036,7 +977,7 @@
  "read_only": 0, 
  "read_only_onload": 0, 
  "restrict_to_domain": "Healthcare", 
- "search_fields": "patient, physician, visit_department", 
+ "search_fields": "patient, physician, visit_department, consultation_date, consultation_time", 
  "show_name_in_global_search": 1, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
diff --git a/erpnext/healthcare/doctype/consultation/consultation.py b/erpnext/healthcare/doctype/consultation/consultation.py
index 69d7ecb..809074e 100755
--- a/erpnext/healthcare/doctype/consultation/consultation.py
+++ b/erpnext/healthcare/doctype/consultation/consultation.py
@@ -123,10 +123,10 @@
 def set_subject_field(consultation):
 	subject = "No Diagnosis "
 	if(consultation.diagnosis):
-		subject = "Diagnosis: \n"+ str(consultation.diagnosis)+". "
+		subject = "Diagnosis: "+ str(consultation.diagnosis)+". "
 	if(consultation.drug_prescription):
 		subject +="\nDrug(s) Prescribed. "
 	if(consultation.test_prescription):
-		subject += " Test(s) Prescribed."
+		subject += "\nTest(s) Prescribed."
 
 	return subject
diff --git a/erpnext/healthcare/doctype/lab_test/lab_test.py b/erpnext/healthcare/doctype/lab_test/lab_test.py
index 6fd9535..766491d 100644
--- a/erpnext/healthcare/doctype/lab_test/lab_test.py
+++ b/erpnext/healthcare/doctype/lab_test/lab_test.py
@@ -230,7 +230,7 @@
 def insert_lab_test_to_medical_record(doc):
 	subject = str(doc.test_name)
 	if(doc.test_comment):
-		subject += ", \n"+str(doc.test_comment)
+		subject += ", "+str(doc.test_comment)
 	medical_record = frappe.new_doc("Patient Medical Record")
 	medical_record.patient = doc.patient
 	medical_record.subject = subject
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
index 14c48b8..1dcdbb5 100644
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
@@ -698,7 +698,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-11-22 16:32:57.240736", 
+ "modified": "2017-12-28 11:26:20.262978", 
  "modified_by": "Administrator", 
  "module": "Healthcare", 
  "name": "Patient Appointment", 
@@ -750,7 +750,7 @@
  "read_only": 0, 
  "read_only_onload": 0, 
  "restrict_to_domain": "Healthcare", 
- "search_fields": "patient, physician, appointment_datetime,department", 
+ "search_fields": "patient, physician, department, appointment_date, appointment_time", 
  "show_name_in_global_search": 1, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
diff --git a/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.json b/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.json
index 6edc0cc..8aa4ede 100644
--- a/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.json
+++ b/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.json
@@ -186,7 +186,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
@@ -389,7 +389,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-11-15 12:48:59.945615", 
+ "modified": "2017-12-27 14:37:40.468854", 
  "modified_by": "Administrator", 
  "module": "Healthcare", 
  "name": "Patient Medical Record", 
diff --git a/erpnext/healthcare/doctype/vital_signs/vital_signs.py b/erpnext/healthcare/doctype/vital_signs/vital_signs.py
index 436f79f..a42ff02 100644
--- a/erpnext/healthcare/doctype/vital_signs/vital_signs.py
+++ b/erpnext/healthcare/doctype/vital_signs/vital_signs.py
@@ -31,18 +31,18 @@
 		frappe.delete_doc("Patient Medical Record", medical_record_id[0][0])
 
 def set_subject_field(doc):
-	subject = " "
+	subject = ""
 	if(doc.temperature):
-		subject += "Temperature: \n"+ str(doc.temperature)+". "
+		subject += "Temperature: "+ str(doc.temperature)+".\n"
 	if(doc.pulse):
-		subject += "Pulse: \n"+ str(doc.pulse)+". "
+		subject += "Pulse: "+ str(doc.pulse)+".\n"
 	if(doc.respiratory_rate):
-		subject += "Respiratory Rate: \n"+ str(doc.respiratory_rate)+". "
+		subject += "Respiratory Rate: "+ str(doc.respiratory_rate)+".\n"
 	if(doc.bp):
-		subject += "BP: \n"+ str(doc.bp)+". "
+		subject += "BP: "+ str(doc.bp)+".\n"
 	if(doc.bmi):
-		subject += "BMI: \n"+ str(doc.bmi)+". "
+		subject += "BMI: "+ str(doc.bmi)+".\n"
 	if(doc.nutrition_note):
-		subject += "Note: \n"+ str(doc.nutrition_note)+". "
+		subject += "Note: "+ str(doc.nutrition_note)+"."
 
 	return subject
diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.js b/erpnext/hr/doctype/salary_slip/test_salary_slip.js
index 43cc27d..06a1c7d 100644
--- a/erpnext/hr/doctype/salary_slip/test_salary_slip.js
+++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.js
@@ -46,7 +46,7 @@
 		() => frappe.timeout(5),
 		() => frappe.set_route('List', 'Salary Slip', 'List'),
 		() => frappe.timeout(2),
-		() => {$('.list-select-all').click();},
+		() => {$('.list-row-checkbox').click();},
 		() => frappe.timeout(2),
 		() => frappe.click_button('Delete'),
 		() => frappe.click_button('Yes'),
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 483736e..711e836 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -717,7 +717,7 @@
 		// toggle read only property for conversion factor field if the uom and stock uom are same
 		if(this.frm.get_field('items').grid.fields_map.conversion_factor) {
 			this.frm.fields_dict.items.grid.toggle_enable("conversion_factor",
-				(item.uom != item.stock_uom)? true: false);
+				((item.uom != item.stock_uom) && !frappe.meta.get_docfield(cur_frm.fields_dict.items.grid.doctype, "conversion_factor").read_only)? true: false);
 		}
 
 	},
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 7d18dd6..eb00e5c 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -457,6 +457,7 @@
    "bold": 1, 
    "collapsible": 0, 
    "columns": 0, 
+   "depends_on": "eval:doc.__islocal", 
    "fieldname": "standard_rate", 
    "fieldtype": "Currency", 
    "hidden": 0, 
@@ -3453,7 +3454,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 1, 
- "modified": "2017-12-27 15:47:17.039337", 
+ "modified": "2017-12-29 14:18:37.731142", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Item", 
diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js
index d4d1a0a..80001d6 100644
--- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js
+++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js
@@ -5,6 +5,7 @@
 	let done = assert.async();
 	frappe.run_serially([
 		() => frappe.set_route('List', 'Stock Reconciliation'),
+		() => frappe.timeout(1),
 		() => frappe.click_button('New'),
 		() => cur_frm.set_value('company','For Testing'),
 		() => frappe.click_button('Items'),