From 0f9849e6727b4fef3e3bf75048de553714b08298 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:39:15 +0530 Subject: [PATCH] fix: not able to create the batch (backport #42784) (#42785) fix: not able to create the batch (#42784) (cherry picked from commit 32c4fab14f83dc5e2cec0c21395713e54d2537c9) Co-authored-by: rohitwaghchaure --- erpnext/stock/doctype/batch/batch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/batch/batch.js b/erpnext/stock/doctype/batch/batch.js index 4ed428421ca..77e4e560acf 100644 --- a/erpnext/stock/doctype/batch/batch.js +++ b/erpnext/stock/doctype/batch/batch.js @@ -3,7 +3,7 @@ frappe.ui.form.on("Batch", { setup: (frm) => { - frm.fields_dict["item"].get_query = function (doc, cdt, cdn) { + frm.set_query("item", () => { return { query: "erpnext.controllers.queries.item_query", filters: { @@ -11,7 +11,7 @@ frappe.ui.form.on("Batch", { has_batch_no: 1, }, }; - }; + }); }, refresh: (frm) => { if (!frm.is_new()) {