fix: batch selection popup not coming for stock entry
diff --git a/erpnext/public/js/utils/serial_no_batch_selector.js b/erpnext/public/js/utils/serial_no_batch_selector.js
index a240e49..02bced2 100644
--- a/erpnext/public/js/utils/serial_no_batch_selector.js
+++ b/erpnext/public/js/utils/serial_no_batch_selector.js
@@ -313,11 +313,15 @@
frappe.throw(__(`Batch ${val} already selected.`));
return;
}
+
+ let batch_number = me.item.batch_no ||
+ this.grid_row.on_grid_fields_dict.batch_no.get_value();
+
if (me.warehouse_details.name) {
frappe.call({
method: 'erpnext.stock.doctype.batch.batch.get_batch_qty',
args: {
- batch_no: me.item.batch_no,
+ batch_no: batch_number,
warehouse: me.warehouse_details.name,
item_code: me.item_code
},
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 2840a70..3af3524 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -60,7 +60,8 @@
}
}
- if(item.s_warehouse) filters["warehouse"] = item.s_warehouse;
+ filters["warehouse"] = item.s_warehouse || item.t_warehouse;
+
return {
query : "erpnext.controllers.queries.get_batch_no",
filters: filters
@@ -964,7 +965,7 @@
}
}
- if(item && !item.has_serial_no && item.has_batch_no) return;
+ if(item && !item.has_serial_no && !item.has_batch_no) return;
if (frm.doc.purpose === 'Material Receipt') return;
frappe.require("assets/erpnext/js/utils/serial_no_batch_selector.js", function() {