From 6f54a7b7d88b48ba965218f43c511e12540f28c8 Mon Sep 17 00:00:00 2001 From: Sun Howwrongbum Date: Fri, 19 Apr 2019 01:44:35 +0530 Subject: [PATCH] fix: scan_barcode field adding invalid items --- erpnext/public/js/controllers/transaction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 168a727f270..ec4e4b7b83b 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -290,7 +290,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ args: { search_value: this.frm.doc.scan_barcode } }).then(r => { const data = r && r.message; - if (!data) { + if (!data || Object.keys(data).length === 0) { scan_barcode_field.set_new_description(__('Cannot find Item with this barcode')); return; }