From 067e8ad50dc2e5d183836979953f80969cb17ce2 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 23 Jan 2020 15:49:39 +0530 Subject: [PATCH] fix: add serial no button not working --- erpnext/public/js/utils/serial_no_batch_selector.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/utils/serial_no_batch_selector.js b/erpnext/public/js/utils/serial_no_batch_selector.js index e64d5458b3..8dd69fdea2 100644 --- a/erpnext/public/js/utils/serial_no_batch_selector.js +++ b/erpnext/public/js/utils/serial_no_batch_selector.js @@ -316,7 +316,7 @@ erpnext.SerialNoBatchSelector = Class.extend({ frappe.call({ method: 'erpnext.stock.doctype.batch.batch.get_batch_qty', args: { - batch_no: this.doc.batch_no, + batch_no: me.item.batch_no, warehouse: me.warehouse_details.name, item_code: me.item_code }, @@ -389,10 +389,13 @@ erpnext.SerialNoBatchSelector = Class.extend({ let serial_no_filters = { item_code: me.item_code, - batch_no: this.doc.batch_no || null, delivery_document_no: "" } + if (this.has_batch) { + serial_no_filters["batch_no"] = this.item.batch_no; + } + if (me.warehouse_details.name) { serial_no_filters['warehouse'] = me.warehouse_details.name; }