patch fixes (#14936)

diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index 0d40b21..4db56f3 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -4493,7 +4493,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2018-07-06 02:38:40.310899",
+ "modified": "2018-07-17 02:38:40.310899",
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Purchase Invoice", 
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index 9f39cbf..c6fb2a1 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -3737,7 +3737,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2018-07-06 11:00:05.037716", 
+ "modified": "2018-07-17 11:00:05.037716", 
  "modified_by": "Administrator", 
  "module": "Buying", 
  "name": "Purchase Order", 
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
index b7e1e33..8f7bb2b 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
@@ -2779,7 +2779,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2018-07-06 02:45:48.616334",
+ "modified": "2018-07-17 02:45:48.616334",
  "modified_by": "Administrator", 
  "module": "Buying", 
  "name": "Supplier Quotation", 
diff --git a/erpnext/patches/v11_0/set_department_for_doctypes.py b/erpnext/patches/v11_0/set_department_for_doctypes.py
index 2741908..b1098ab 100644
--- a/erpnext/patches/v11_0/set_department_for_doctypes.py
+++ b/erpnext/patches/v11_0/set_department_for_doctypes.py
@@ -3,14 +3,21 @@
 # Set department value based on employee value
 
 def execute():
-	doctypes_to_update = ['Appraisal', 'Leave Allocation', 'Expense Claim', 'Instructor', 'Salary Slip',
-		'Attendance', 'Training Feedback', 'Training Result Employee',
-		'Leave Application', 'Employee Advance', 'Activity Cost', 'Training Event Employee',
-		'Timesheet', 'Sales Person', 'Payroll Employee Detail']
 
-	for doctype in doctypes_to_update:
-		if frappe.db.table_exists(doctype):
-			frappe.db.sql("""
-				update `tab%s` dt
-				set department=(select department from `tabEmployee` where name=dt.employee)
-			""" % doctype)
\ No newline at end of file
+	doctypes_to_update = {
+		'hr': ['Appraisal', 'Leave Allocation', 'Expense Claim', 'Salary Slip',
+			'Attendance', 'Training Feedback', 'Training Result Employee','Leave Application',
+			'Employee Advance', 'Training Event Employee', 'Payroll Employee Detail'],
+		'education': ['Instructor'],
+		'projects': ['Activity Cost', 'Timesheet'],
+		'setup': ['Sales Person']
+	}
+
+	for module, doctypes in doctypes_to_update.items():
+		for doctype in doctypes:
+			if frappe.db.table_exists(doctype):
+				frappe.reload_doc(module, 'doctype', frappe.scrub(doctype))
+				frappe.db.sql("""
+					update `tab%s` dt
+					set department=(select department from `tabEmployee` where name=dt.employee)
+				""" % doctype)
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index ccbb942..d3ca4f8 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -3163,7 +3163,7 @@
  "istable": 0, 
  "max_attachments": 1, 
  "menu_index": 0, 
- "modified": "2018-07-06 03:23:15.354674",
+ "modified": "2018-07-17 03:23:15.354674",
  "modified_by": "Administrator",
  "module": "Selling", 
  "name": "Quotation", 
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index ffcda03..5572baf 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -3881,7 +3881,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2018-07-06 03:03:35.035396",
+ "modified": "2018-07-17 03:03:35.035396",
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Delivery Note", 
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
index 1f47317..51ccfcd 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -3436,7 +3436,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2018-07-06 02:59:59.609643",
+ "modified": "2018-07-17 02:59:59.609643",
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Purchase Receipt",