diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py
index 3349303..226b17f 100644
--- a/erpnext/controllers/item_variant.py
+++ b/erpnext/controllers/item_variant.py
@@ -169,6 +169,7 @@
 
 	return variant
 
+
 def copy_attributes_to_variant(item, variant):
 	from frappe.model import no_value_fields
 
@@ -181,8 +182,9 @@
 		exclude_fields += ['manufacturer', 'manufacturer_part_no']
 
 	for field in item.meta.fields:
-		if field.fieldtype not in no_value_fields and (not field.no_copy)\
-			and field.fieldname not in exclude_fields:
+		# "Table" is part of `no_value_field` but we shouldn't ignore tables
+		if (field.fieldtype == 'Table' or field.fieldtype not in no_value_fields) \
+			and (not field.no_copy) and field.fieldname not in exclude_fields:
 			if variant.get(field.fieldname) != item.get(field.fieldname):
 				variant.set(field.fieldname, item.get(field.fieldname))
 	variant.variant_of = item.name
diff --git a/erpnext/controllers/tests/test_item_variant.py b/erpnext/controllers/tests/test_item_variant.py
new file mode 100644
index 0000000..9fc45d2
--- /dev/null
+++ b/erpnext/controllers/tests/test_item_variant.py
@@ -0,0 +1,58 @@
+from __future__ import unicode_literals
+
+import frappe
+import json
+import unittest
+
+from erpnext.controllers.item_variant import copy_attributes_to_variant, make_variant_item_code
+
+# python 3 compatibility stuff
+try:
+	unicode = unicode
+except NameError:
+	# Python 3
+	basestring = (str, bytes)
+else:
+	# Python 2
+	basestring = basestring
+
+
+def create_variant_with_tables(item, args):
+	if isinstance(args, basestring):
+		args = json.loads(args)
+
+	template = frappe.get_doc("Item", item)
+	template.quality_parameters.append({
+		"specification": "Moisture",
+		"value": "&lt; 5%",
+	})
+	variant = frappe.new_doc("Item")
+	variant.variant_based_on = 'Item Attribute'
+	variant_attributes = []
+
+	for d in template.attributes:
+		variant_attributes.append({
+			"attribute": d.attribute,
+			"attribute_value": args.get(d.attribute)
+		})
+
+	variant.set("attributes", variant_attributes)
+	copy_attributes_to_variant(template, variant)
+	make_variant_item_code(template.item_code, template.item_name, variant)
+
+	return variant
+
+
+def make_item_variant():
+	frappe.delete_doc_if_exists("Item", "_Test Variant Item-S", force=1)
+	variant = create_variant_with_tables("_Test Variant Item", '{"Test Size": "Small"}')
+	variant.item_code = "_Test Variant Item-S"
+	variant.item_name = "_Test Variant Item-S"
+	variant.save()
+	return variant
+
+
+class TestItemVariant(unittest.TestCase):
+	def test_tables_in_template_copied_to_variant(self):
+		variant = make_item_variant()
+		self.assertNotEqual(variant.get("quality_parameters"), [])
diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
index 8670f73..fdb65cd 100644
--- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
@@ -85,12 +85,7 @@
 		self._test_auto_material_request("_Test Item Warehouse Group Wise Reorder", warehouse="_Test Warehouse Group-C1 - _TC")
 
 	def _test_auto_material_request(self, item_code, material_request_type="Purchase", warehouse="_Test Warehouse - _TC"):
-		item = frappe.get_doc("Item", item_code)
-
-		if item.variant_of:
-			template = frappe.get_doc("Item", item.variant_of)
-		else:
-			template = item
+		variant = frappe.get_doc("Item", item_code)
 
 		projected_qty, actual_qty = frappe.db.get_value("Bin", {"item_code": item_code,
 			"warehouse": warehouse}, ["projected_qty", "actual_qty"]) or [0, 0]
@@ -105,10 +100,10 @@
 		frappe.db.set_value("Stock Settings", None, "auto_indent", 1)
 
 		# update re-level qty so that it is more than projected_qty
-		if projected_qty >= template.reorder_levels[0].warehouse_reorder_level:
-			template.reorder_levels[0].warehouse_reorder_level += projected_qty
-			template.reorder_levels[0].material_request_type = material_request_type
-			template.save()
+		if projected_qty >= variant.reorder_levels[0].warehouse_reorder_level:
+			variant.reorder_levels[0].warehouse_reorder_level += projected_qty
+			variant.reorder_levels[0].material_request_type = material_request_type
+			variant.save()
 
 		from erpnext.stock.reorder_item import reorder_item
 		mr_list = reorder_item()
