From 1907c8f30b439cfb3c3b4aa1a75c99e1d3b5510d Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Thu, 31 Dec 2020 11:03:42 +0530 Subject: [PATCH] fix: Minor Issues --- erpnext/public/js/utils/serial_no_batch_selector.js | 8 ++++++-- erpnext/stock/doctype/batch/batch.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/utils/serial_no_batch_selector.js b/erpnext/public/js/utils/serial_no_batch_selector.js index 297012d78fe..2df5634132d 100644 --- a/erpnext/public/js/utils/serial_no_batch_selector.js +++ b/erpnext/public/js/utils/serial_no_batch_selector.js @@ -223,7 +223,9 @@ erpnext.SerialNoBatchSelector = Class.extend({ frappe.model.set_value(row.doctype, row.name, 'batch_no', batch_no); } else { row = this.frm.doc.items.find(i => i.batch_no === batch_no); - frappe.model.set_value(row.doctype, row.name, 'batch_no', batch_no); + if (row) { + frappe.model.set_value(row.doctype, row.name, 'batch_no', batch_no); + } } if (!row) { @@ -272,7 +274,9 @@ erpnext.SerialNoBatchSelector = Class.extend({ frappe.model.set_value(row.doctype, row.name, 'batch_no', batch_no); } else { row = this.frm.doc.items.find(i => i.batch_no === batch_no); - frappe.model.set_value(row.doctype, row.name, 'batch_no', batch_no); + if (row) { + frappe.model.set_value(row.doctype, row.name, 'batch_no', batch_no); + } } const values = { 'qty': serial_no.length, diff --git a/erpnext/stock/doctype/batch/batch.js b/erpnext/stock/doctype/batch/batch.js index 15a0a351aa0..c44f23f2dae 100644 --- a/erpnext/stock/doctype/batch/batch.js +++ b/erpnext/stock/doctype/batch/batch.js @@ -10,7 +10,7 @@ frappe.ui.form.on('Batch', { 'is_stock_item': 1, 'has_batch_no': 1 } - } + }; }; frm.set_query('selling_price', function() {