[new feature] Product Configurator (via Item Quick Entry) (#11535)

* [Feature] Item Variant Creation from Quick Entry

* [minor] formatted js

* [minor] set 3 attribute per page instead of 5 in template

* [fix] fixed codecy issue

* [fix] label translation

* [minor] changed trigger event of item template

* [fix] moved item ui tests under stock

* [UI test] added test for item attribute

* [UI test] added test for creation of item variant from quick entry

* [fix] item variant ui test fixes

* [wip]

* [cleanup] item quick entry

* [remove] tests, fixtures were missing

* [refactor] use set_only_once in item
diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py
index f40d519..821c81c 100644
--- a/erpnext/controllers/item_variant.py
+++ b/erpnext/controllers/item_variant.py
@@ -239,3 +239,20 @@
 	if abbreviations:
 		variant.item_code = "{0}-{1}".format(template_item_code, "-".join(abbreviations))
 		variant.item_name = "{0}-{1}".format(template_item_name, "-".join(abbreviations))
+
+@frappe.whitelist()
+def create_variant_doc_for_quick_entry(template, args):
+	variant_based_on = frappe.db.get_value("Item", template, "variant_based_on")
+	args = json.loads(args)
+	if variant_based_on == "Manufacturer":
+		variant = get_variant(template, **args)
+	else:
+		existing_variant = get_variant(template, args)
+		if existing_variant:
+			return existing_variant
+		else:
+			variant = create_variant(template, args=args)
+			variant.name = variant.item_code
+			validate_item_variant_attributes(variant, args)
+	return variant.as_dict()
+