Merge pull request #21037 from rohitwaghchaure/fixed_batch_selector_popup_develop

fix: batch selection popup not coming for stock entry
This commit is contained in:
rohitwaghchaure 2020-03-24 16:32:21 +05:30 committed by GitHub
commit b6bb56e9bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -313,11 +313,15 @@ erpnext.SerialNoBatchSelector = Class.extend({
frappe.throw(__(`Batch ${val} already selected.`)); frappe.throw(__(`Batch ${val} already selected.`));
return; return;
} }
let batch_number = me.item.batch_no ||
this.grid_row.on_grid_fields_dict.batch_no.get_value();
if (me.warehouse_details.name) { if (me.warehouse_details.name) {
frappe.call({ frappe.call({
method: 'erpnext.stock.doctype.batch.batch.get_batch_qty', method: 'erpnext.stock.doctype.batch.batch.get_batch_qty',
args: { args: {
batch_no: me.item.batch_no, batch_no: batch_number,
warehouse: me.warehouse_details.name, warehouse: me.warehouse_details.name,
item_code: me.item_code item_code: me.item_code
}, },

View File

@ -60,7 +60,8 @@ frappe.ui.form.on('Stock Entry', {
} }
} }
if(item.s_warehouse) filters["warehouse"] = item.s_warehouse; filters["warehouse"] = item.s_warehouse || item.t_warehouse;
return { return {
query : "erpnext.controllers.queries.get_batch_no", query : "erpnext.controllers.queries.get_batch_no",
filters: filters filters: filters
@ -964,7 +965,7 @@ erpnext.stock.select_batch_and_serial_no = (frm, item) => {
} }
} }
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; if (frm.doc.purpose === 'Material Receipt') return;
frappe.require("assets/erpnext/js/utils/serial_no_batch_selector.js", function() { frappe.require("assets/erpnext/js/utils/serial_no_batch_selector.js", function() {