fix: scan_barcode field adding invalid items

This commit is contained in:
Sun Howwrongbum
2019-04-19 01:44:35 +05:30
committed by GitHub
parent 22ad81fb57
commit 6f54a7b7d8

View File

@@ -290,7 +290,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
args: { search_value: this.frm.doc.scan_barcode } args: { search_value: this.frm.doc.scan_barcode }
}).then(r => { }).then(r => {
const data = r && r.message; 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')); scan_barcode_field.set_new_description(__('Cannot find Item with this barcode'));
return; return;
} }