Merge pull request #14165 from codingCoffee/min

relieving_date wasnt of type datetime
diff --git a/erpnext/patches/v11_0/create_department_records_for_each_company.py b/erpnext/patches/v11_0/create_department_records_for_each_company.py
index bef524c..17e3ebd 100644
--- a/erpnext/patches/v11_0/create_department_records_for_each_company.py
+++ b/erpnext/patches/v11_0/create_department_records_for_each_company.py
@@ -47,6 +47,9 @@
 				THEN "%s"
 			'''%(company, department, records[department]))
 
+	if not when_then:
+		return
+
 	frappe.db.sql("""
 		update
 			`tab%s`
diff --git a/erpnext/patches/v11_0/refactor_erpnext_shopify.py b/erpnext/patches/v11_0/refactor_erpnext_shopify.py
index c8d4de8..d344ae3 100644
--- a/erpnext/patches/v11_0/refactor_erpnext_shopify.py
+++ b/erpnext/patches/v11_0/refactor_erpnext_shopify.py
@@ -22,7 +22,7 @@
 def setup_app_type():
 	shopify_settings = frappe.get_doc("Shopify Settings")
 	shopify_settings.app_type = 'Private'
-	shopify_settings.update_price_in_erpnext_price_list =  0 if shopify_settings.push_prices_to_shopify else 1
+	shopify_settings.update_price_in_erpnext_price_list =  0 if getattr(shopify_settings, 'push_prices_to_shopify', None) else 1
 	shopify_settings.flags.ignore_mandatory = True
 	shopify_settings.ignore_permissions = True
 	shopify_settings.save()
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 849a294..4a9c029 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -566,7 +566,7 @@
 		item = frappe.db.sql("""select i.stock_uom, i.description, i.image, i.item_name, i.item_group,
 				i.has_batch_no, i.sample_quantity, i.has_serial_no,
 				id.expense_account, id.buying_cost_center
-			from `tabItem`, `tabItem Default` id
+			from `tabItem` i, `tabItem Default` id
 			where i.name=%s and i.name=id.parent and id.company=%s
 				and i.disabled=0
 				and (i.end_of_life is null or i.end_of_life='0000-00-00' or i.end_of_life > %s)""",