Merge branch 'develop' of https://github.com/frappe/erpnext into youtube-analytics
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index 502dbba..4201e0b 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -1084,7 +1084,7 @@
  "idx": 105,
  "is_submittable": 1,
  "links": [],
- "modified": "2020-07-18 05:09:33.800633",
+ "modified": "2020-07-31 14:13:44.610190",
  "modified_by": "Administrator",
  "module": "Buying",
  "name": "Purchase Order",
@@ -1135,5 +1135,5 @@
  "sort_field": "modified",
  "sort_order": "DESC",
  "timeline_field": "supplier",
- "title_field": "title"
+ "title_field": "supplier"
 }
\ No newline at end of file
diff --git a/erpnext/erpnext_integrations/taxjar_integration.py b/erpnext/erpnext_integrations/taxjar_integration.py
index 633692d..24fc3d4 100644
--- a/erpnext/erpnext_integrations/taxjar_integration.py
+++ b/erpnext/erpnext_integrations/taxjar_integration.py
@@ -1,8 +1,5 @@
 import traceback
 
-import pycountry
-import taxjar
-
 import frappe
 from erpnext import get_default_company
 from frappe import _
@@ -32,6 +29,7 @@
 
 
 def create_transaction(doc, method):
+	import taxjar
 	"""Create an order transaction in TaxJar"""
 
 	if not TAXJAR_CREATE_TRANSACTIONS:
@@ -208,6 +206,7 @@
 
 
 def get_iso_3166_2_state_code(address):
+	import pycountry
 	country_code = frappe.db.get_value("Country", address.get("country"), "code")
 
 	error_message = _("""{0} is not a valid state! Check for typos or enter the ISO code for your state.""").format(address.get("state"))
diff --git a/erpnext/hr/report/recruitment_analytics/recruitment_analytics.py b/erpnext/hr/report/recruitment_analytics/recruitment_analytics.py
index 8672094..e961114 100644
--- a/erpnext/hr/report/recruitment_analytics/recruitment_analytics.py
+++ b/erpnext/hr/report/recruitment_analytics/recruitment_analytics.py
@@ -96,33 +96,35 @@
 
 def get_parent_row(sp_jo_map, sp, jo_ja_map, ja_joff_map):
 	data = []
-	for jo in sp_jo_map[sp]:
-		row = {
-			"staffing_plan" : sp,
-			"job_opening" : jo["name"],
-		}
-		data.append(row)
-		child_row = get_child_row( jo["name"], jo_ja_map, ja_joff_map)
-		data += child_row
+	if sp in sp_jo_map.keys():
+		for jo in sp_jo_map[sp]:
+			row = {
+				"staffing_plan" : sp,
+				"job_opening" : jo["name"],
+			}
+			data.append(row)
+			child_row = get_child_row( jo["name"], jo_ja_map, ja_joff_map)
+			data += child_row
 	return data
 
 def get_child_row(jo, jo_ja_map, ja_joff_map):
 	data = []
-	for ja in jo_ja_map[jo]:
-		row = {
-			"indent":1,
-			"job_applicant": ja.name,
-			"applicant_name": ja.applicant_name,
-			"application_status": ja.status,
-		}
-		if ja.name in ja_joff_map.keys():
-			jo_detail =ja_joff_map[ja.name][0]
-			row["job_offer"] = jo_detail.name
-			row["job_offer_status"] = jo_detail.status
-			row["offer_date"]= jo_detail.offer_date.strftime("%d-%m-%Y")
-			row["designation"] = jo_detail.designation
+	if jo in jo_ja_map.keys():
+		for ja in jo_ja_map[jo]:
+			row = {
+				"indent":1,
+				"job_applicant": ja.name,
+				"applicant_name": ja.applicant_name,
+				"application_status": ja.status,
+			}
+			if ja.name in ja_joff_map.keys():
+				jo_detail =ja_joff_map[ja.name][0]
+				row["job_offer"] = jo_detail.name
+				row["job_offer_status"] = jo_detail.status
+				row["offer_date"]= jo_detail.offer_date.strftime("%d-%m-%Y")
+				row["designation"] = jo_detail.designation
 
-		data.append(row)
+			data.append(row)
 	return data
 
 def get_staffing_plan(filters):
@@ -177,7 +179,7 @@
 def get_job_offer(ja_list):
 	ja_joff_map = {}
 
-	offers = frappe.get_all("Job offer", filters = [["job_applicant", "IN", ja_list]], fields =["name", "job_applicant", "status", 'offer_date', 'designation'])
+	offers = frappe.get_all("Job Offer", filters = [["job_applicant", "IN", ja_list]], fields =["name", "job_applicant", "status", 'offer_date', 'designation'])
 
 	for offer in offers:
 		if offer.job_applicant not in ja_joff_map.keys():
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index 8fa56ac..a68b738 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -1,7 +1,6 @@
 {
  "actions": [],
  "allow_import": 1,
- "allow_workflow": 1,
  "autoname": "naming_series:",
  "creation": "2013-06-18 12:39:59",
  "doctype": "DocType",
@@ -1461,7 +1460,7 @@
  "idx": 105,
  "is_submittable": 1,
  "links": [],
- "modified": "2020-07-18 05:13:06.680696",
+ "modified": "2020-07-31 14:13:17.962015",
  "modified_by": "Administrator",
  "module": "Selling",
  "name": "Sales Order",
@@ -1535,7 +1534,7 @@
  "sort_field": "modified",
  "sort_order": "DESC",
  "timeline_field": "customer",
- "title_field": "title",
+ "title_field": "customer",
  "track_changes": 1,
  "track_seen": 1
 }
\ No newline at end of file