Merge pull request #8226 from mbauskar/item-varient-fix

[minor] make varient fixes in item.js
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index 8327ea7..3402619 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -259,8 +259,6 @@
 	},
 
 	make_variant: function(frm) {
-		var fields = []
-
 		if(frm.doc.variant_based_on==="Item Attribute") {
 			erpnext.item.show_modal_for_item_attribute_selection(frm);
 		} else {
@@ -299,6 +297,8 @@
 	},
 
 	show_modal_for_item_attribute_selection: function(frm) {
+		var fields = []
+
 		for(var i=0;i< frm.doc.attributes.length;i++){
 			var fieldtype, desc;
 			var row = frm.doc.attributes[i];