diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py
index e0acd73edf..d0d893a38b 100644
--- a/erpnext/controllers/item_variant.py
+++ b/erpnext/controllers/item_variant.py
@@ -124,16 +124,8 @@ def find_variant(template, args, variant_item_code=None):
conditions = " or ".join(conditions)
- # use approximate match and shortlist possible variant matches
- # it is approximate because we are matching using OR condition
- # and it need not be exact match at this stage
- # this uses a simpler query instead of using multiple exists conditions
- possible_variants = frappe.db.sql_list("""select name from `tabItem` item
- where variant_of=%s and exists (
- select name from `tabItem Variant Attribute` iv_attribute
- where iv_attribute.parent=item.name
- and ({conditions}) and parent != %s
- )""".format(conditions=conditions), (template, cstr(variant_item_code)))
+ from erpnext.portal.product_configurator.utils import get_item_codes_by_attributes
+ possible_variants = [i for i in get_item_codes_by_attributes(args, template) if i != variant_item_code]
for variant in possible_variants:
variant = frappe.get_doc("Item", variant)
diff --git a/erpnext/portal/product_configurator/utils.py b/erpnext/portal/product_configurator/utils.py
index 405a6d8c31..ae47e8bc4c 100644
--- a/erpnext/portal/product_configurator/utils.py
+++ b/erpnext/portal/product_configurator/utils.py
@@ -102,6 +102,9 @@ def get_item_codes_by_attributes(attribute_filters, template_item_code=None):
for attribute, values in attribute_filters.items():
attribute_values = values
+ if isinstance(attribute_values, frappe.string_types):
+ attribute_values = [attribute_values]
+
if not attribute_values: continue
wheres = []
diff --git a/erpnext/public/js/utils/item_quick_entry.js b/erpnext/public/js/utils/item_quick_entry.js
index 62b82ac012..2947d5b98e 100644
--- a/erpnext/public/js/utils/item_quick_entry.js
+++ b/erpnext/public/js/utils/item_quick_entry.js
@@ -390,15 +390,6 @@ frappe.ui.form.ItemQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
}
})
- if (mandatory.length) {
- frappe.msgprint({
- title: __('Missing Values Required'),
- message: __('Following fields have missing values:') + '