Merge pull request #4558 from nabinhait/item_variants

[fix] Disable atrribute table in variant item record
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py
index b10b72f..2a6ab88 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.py
@@ -140,7 +140,7 @@
 		clear_doctype_notifications(self)
 
 	def on_submit(self):
-		if self.has_drop_ship_item():
+		if self.is_against_so():
 			self.update_status_updater()
 
 		super(PurchaseOrder, self).on_submit()
@@ -157,8 +157,10 @@
 		purchase_controller.update_last_purchase_rate(self, is_submit = 1)
 
 	def on_cancel(self):
-		if self.has_drop_ship_item():
+		if self.is_against_so():
 			self.update_status_updater()
+			
+		if self.has_drop_ship_item():
 			self.update_delivered_qty_in_sales_order()
 
 		pc_obj = frappe.get_doc('Purchase Common')
@@ -222,13 +224,10 @@
 			so.notify_update()
 
 	def has_drop_ship_item(self):
-		is_drop_ship = False
-
-		for item in self.items:
-			if item.delivered_by_supplier == 1:
-				is_drop_ship = True
-
-		return is_drop_ship
+		return any([d.delivered_by_supplier for d in self.items])
+		
+	def is_against_so(self):
+		return any([d.prevdoc_doctype for d in self.items if d.prevdoc_doctype=="Sales Order"])
 
 	def set_received_qty_for_drop_ship_items(self):
 		for item in self.items:
diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py
index 4d4cc6d..9892e71 100644
--- a/erpnext/setup/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/setup_wizard/setup_wizard.py
@@ -106,8 +106,23 @@
 	}).insert()
 
 	# Bank Account
+	create_bank_account(args)
 
 	args["curr_fiscal_year"] = curr_fiscal_year
+	
+def create_bank_account(args):
+	if args.get("bank_account"):
+		bank_account_group =  frappe.db.get_value("Account", 
+			{"account_type": "Bank", "is_group": 1, "root_type": "Asset"})
+		if bank_account_group:
+			frappe.get_doc({
+				"doctype": "Account",
+				'account_name': args.get("bank_account"),
+				'parent_account': bank_account_group,
+				'is_group':0,
+				'company':args.get('company_name').strip(),
+				"account_type": "Bank",
+			}).insert()
 
 def create_price_lists(args):
 	for pl_type, pl_name in (("Selling", _("Standard Selling")), ("Buying", _("Standard Buying"))):