Merge pull request #50048 from rohitwaghchaure/fixed-unhide-field

fix: show qty in popup while making additional transfer entry
This commit is contained in:
rohitwaghchaure
2025-10-13 17:27:43 +05:30
committed by GitHub
2 changed files with 27 additions and 13 deletions

View File

@@ -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({

View File

@@ -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",