Merge pull request #3353 from rmehta/barcode-fix

[fix] clear barcode from table, fixes #3320
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 1e4ec7f..3ef8525 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -125,6 +125,11 @@
 	},
 
 	barcode: function(doc, cdt, cdn) {
+		var d = locals[cdt][cdn];
+		if(d.barcode=="" || d.barcode==null) {
+			// barcode cleared, remove item
+			d.item_code = "";
+		}
 		this.item_code(doc, cdt, cdn);
 	},