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; }