mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-20 05:29:18 +00:00
Merge pull request #50048 from rohitwaghchaure/fixed-unhide-field
fix: show qty in popup while making additional transfer entry
This commit is contained in:
@@ -767,12 +767,24 @@ erpnext.work_order = {
|
|||||||
frm.add_custom_button(
|
frm.add_custom_button(
|
||||||
__("Additional Material Transfer"),
|
__("Additional Material Transfer"),
|
||||||
function () {
|
function () {
|
||||||
erpnext.work_order.make_se(
|
let purpose = "Material Transfer for Manufacture";
|
||||||
frm,
|
erpnext.work_order
|
||||||
"Material Transfer for Manufacture",
|
.show_prompt_for_qty_input(frm, purpose, qty, 1)
|
||||||
qty,
|
.then((data) => {
|
||||||
1
|
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")
|
__("Make")
|
||||||
);
|
);
|
||||||
@@ -940,8 +952,8 @@ erpnext.work_order = {
|
|||||||
return flt(max, precision("qty"));
|
return flt(max, precision("qty"));
|
||||||
},
|
},
|
||||||
|
|
||||||
show_prompt_for_qty_input: function (frm, purpose) {
|
show_prompt_for_qty_input: function (frm, purpose, qty, additional_transfer_entry) {
|
||||||
let max = this.get_max_transferable_qty(frm, purpose);
|
let max = !additional_transfer_entry ? this.get_max_transferable_qty(frm, purpose) : qty;
|
||||||
|
|
||||||
let fields = [
|
let fields = [
|
||||||
{
|
{
|
||||||
@@ -951,7 +963,10 @@ erpnext.work_order = {
|
|||||||
description: __("Max: {0}", [max]),
|
description: __("Max: {0}", [max]),
|
||||||
default: max,
|
default: max,
|
||||||
},
|
},
|
||||||
{
|
];
|
||||||
|
|
||||||
|
if (!additional_transfer_entry) {
|
||||||
|
fields.push({
|
||||||
fieldtype: "Check",
|
fieldtype: "Check",
|
||||||
label: __("Consider Process Loss"),
|
label: __("Consider Process Loss"),
|
||||||
fieldname: "consider_process_loss",
|
fieldname: "consider_process_loss",
|
||||||
@@ -963,8 +978,8 @@ erpnext.work_order = {
|
|||||||
frm.qty_prompt.set_value("qty", max);
|
frm.qty_prompt.set_value("qty", max);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
});
|
||||||
];
|
}
|
||||||
|
|
||||||
if (purpose === "Disassemble") {
|
if (purpose === "Disassemble") {
|
||||||
fields.push({
|
fields.push({
|
||||||
|
|||||||
@@ -706,7 +706,6 @@
|
|||||||
"depends_on": "eval:doc.purpose == \"Material Transfer for Manufacture\"",
|
"depends_on": "eval:doc.purpose == \"Material Transfer for Manufacture\"",
|
||||||
"fieldname": "is_additional_transfer_entry",
|
"fieldname": "is_additional_transfer_entry",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 1,
|
|
||||||
"label": "Is Additional Transfer Entry",
|
"label": "Is Additional Transfer Entry",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
}
|
}
|
||||||
@@ -716,7 +715,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-09-29 15:56:21.344296",
|
"modified": "2025-10-13 15:09:23.905118",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Stock Entry",
|
"name": "Stock Entry",
|
||||||
|
|||||||
Reference in New Issue
Block a user