From a0b85d060b2f0491567f2dbda1ccd2d11877b658 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 3 Jun 2019 11:57:00 +0530 Subject: [PATCH] fix: Serial no filtering issue for delivered items --- erpnext/public/js/utils/serial_no_batch_selector.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/utils/serial_no_batch_selector.js b/erpnext/public/js/utils/serial_no_batch_selector.js index b94cdd8c4c3..d8ebe33e8a5 100644 --- a/erpnext/public/js/utils/serial_no_batch_selector.js +++ b/erpnext/public/js/utils/serial_no_batch_selector.js @@ -342,13 +342,24 @@ erpnext.SerialNoBatchSelector = Class.extend({ get_serial_no_fields: function() { var me = this; this.serial_list = []; + + let serial_no_filters = { + item_code: me.item_code, + delivery_document_no: ["in", ""] + } + + if (me.warehouse_details.name) { + serial_no_filters['warehouse'] = me.warehouse_details.name; + } return [ {fieldtype: 'Section Break', label: __('Serial No')}, { fieldtype: 'Link', fieldname: 'serial_no_select', options: 'Serial No', label: __('Select'), get_query: function() { - return { filters: {item_code: me.item_code, warehouse: me.warehouse_details.name}}; + return { + filters: serial_no_filters + }; }, onchange: function(e) { if(this.in_local_change) return;