From b08e0014f7835235279cd21d56a6af3b0fa7f29a Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 13 Oct 2025 16:27:52 +0530 Subject: [PATCH] fix: show qty in popup while making additional transfer entry --- .../doctype/work_order/work_order.js | 37 +++++++++++++------ .../doctype/stock_entry/stock_entry.json | 3 +- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/erpnext/manufacturing/doctype/work_order/work_order.js b/erpnext/manufacturing/doctype/work_order/work_order.js index 642c071dbc0..fda8b515a49 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.js +++ b/erpnext/manufacturing/doctype/work_order/work_order.js @@ -767,12 +767,24 @@ erpnext.work_order = { frm.add_custom_button( __("Additional Material Transfer"), function () { - erpnext.work_order.make_se( - frm, - "Material Transfer for Manufacture", - qty, - 1 - ); + let purpose = "Material Transfer for Manufacture"; + erpnext.work_order + .show_prompt_for_qty_input(frm, purpose, qty, 1) + .then((data) => { + return frappe.xcall( + "erpnext.manufacturing.doctype.work_order.work_order.make_stock_entry", + { + work_order_id: frm.doc.name, + purpose: purpose, + qty: data.qty, + is_additional_transfer_entry: 1, + } + ); + }) + .then((stock_entry) => { + frappe.model.sync(stock_entry); + frappe.set_route("Form", stock_entry.doctype, stock_entry.name); + }); }, __("Make") ); @@ -940,8 +952,8 @@ erpnext.work_order = { return flt(max, precision("qty")); }, - show_prompt_for_qty_input: function (frm, purpose) { - let max = this.get_max_transferable_qty(frm, purpose); + show_prompt_for_qty_input: function (frm, purpose, qty, additional_transfer_entry) { + let max = !additional_transfer_entry ? this.get_max_transferable_qty(frm, purpose) : qty; let fields = [ { @@ -951,7 +963,10 @@ erpnext.work_order = { description: __("Max: {0}", [max]), default: max, }, - { + ]; + + if (!additional_transfer_entry) { + fields.push({ fieldtype: "Check", label: __("Consider Process Loss"), fieldname: "consider_process_loss", @@ -963,8 +978,8 @@ erpnext.work_order = { frm.qty_prompt.set_value("qty", max); } }, - }, - ]; + }); + } if (purpose === "Disassemble") { fields.push({ diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.json b/erpnext/stock/doctype/stock_entry/stock_entry.json index c2c17416c3e..3211dc425f1 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.json +++ b/erpnext/stock/doctype/stock_entry/stock_entry.json @@ -706,7 +706,6 @@ "depends_on": "eval:doc.purpose == \"Material Transfer for Manufacture\"", "fieldname": "is_additional_transfer_entry", "fieldtype": "Check", - "hidden": 1, "label": "Is Additional Transfer Entry", "read_only": 1 } @@ -716,7 +715,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2025-09-29 15:56:21.344296", + "modified": "2025-10-13 15:09:23.905118", "modified_by": "Administrator", "module": "Stock", "name": "Stock Entry",