Merge pull request #10448 from joelios/selfpostback

improvement for self-postbacks
diff --git a/erpnext/templates/includes/product_page.js b/erpnext/templates/includes/product_page.js
index 3905959..b2d5ad9 100644
--- a/erpnext/templates/includes/product_page.js
+++ b/erpnext/templates/includes/product_page.js
@@ -73,7 +73,7 @@
 			}
 		}
 
-		if (window.location.search.indexOf(item_code)!==-1) {
+		if (window.location.search == ("?variant=" + item_code) || window.location.search.includes(item_code)) {
 			return;
 		}